Reloading JSP page when there is any update in the database
Keerthi Chandhu
Greenhorn
Joined: Feb 03, 2009
Posts: 16
posted
0
Hi,
Can anyone please suggest me how to reload a JSP page when user updates any value in the database from the screen?
Actually when user changes any value in the JSP it is being updated in the database but it is not giving the updated value in the JSP until user manually Refresh the page.
1) Scriptlets always indicate a bad practice.
2) Code duplication is always a bad practice.
3) You're overriding the correct Cache-Control header with an incorrect one.
Put following scriptlet at the beginning of the JSP to prevent output caching
Keerthi Chandhu
Greenhorn
Joined: Feb 03, 2009
Posts: 16
posted
0
Hi Ujjwal soni ,
Thank you so much for the reply.
I tried making cache control
but it is not updating with the updated value utill I click refresh manually.
Actually to decrease number of queries to database, I am passing database values as parameters to another jsp and while displaying I am getting those parameters using
when I update this value, it is getting updated in database but it is not displaying the updated value until I click refresh manually.
Would appreciate your help.
ujjwal soni wrote:Put following scriptlet at the beginning of the JSP to prevent output caching
As previously pointed out, scriptlets are a poor practice. This should either be done in the page controller, or better yet, in a filter.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
ujjwal soni wrote:Hi,
Thanks for your suggestion...
You're good at Googling. Why don't you explain the topicstarter how to do it so that s/he can learn from it? Why don't you mention the source of this information?