I have one servlet and jsp. I am setting attribute by request.setattribute("acknowledgement", success)
in servlet and getting that attribute on jsp. Based on the value of the attribute on jsp I am printing success message. The problem is when I am refreshing the jsp. The attribute's value remaining same and show message of success, because of previous value of that attribute. How can I have the attributes cleared on a refresh?
Asked
Active
Viewed 186 times
0

MrAlias
- 1,316
- 15
- 26

Akshay Siddhpura
- 35
- 1
- 5
-
Java script is work at client side and servlet and java code work at server side so before java script come java code already executed so I cant set variable or attribute from javascript – Akshay Siddhpura Aug 09 '14 at 05:21
-
try with session attribute.!! it would help though.!! Example link is here http://www.jsptut.com/sessions.jsp – Wanna Coffee Aug 09 '14 at 06:17
-
You might want to check this answer: http://stackoverflow.com/questions/17289829/reset-a-value-to-zero-upon-refresh – user63762453 Aug 09 '14 at 06:52
-
If I am setting in session then it will reset when I log out from the page .At the time of refresh it will remain same because it is in same session. – Akshay Siddhpura Aug 09 '14 at 15:10