Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

updating database records via jsp

 
Joseph Rudman
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm creating an application which enables a user to view client data stored in a mysql database.

A servlet takes in username/login and if correct user is taken to jsp that displays the first record - user can then select next, user will then be taken to another jsp displaying next record, and on this jsp user can then view next or previous records.

But user should also be able to update the client data shown to user.

So I was going to add an update button to jsp's and when user updated any field on jsp displayed to user - he/she would then hit update button which would trigger updates in database using relevant sql, but how would I redisplay the same jsp with updated fields.

Currently if user hits any submit button he/she is taken to another field which displays the next record as follows:
<FORM method="POST" action="/ProcessClientsThen.jsp">

so basically what i'm asking is how would I get the jsp to refresh showing updated database informattion if user hits the Update submit button.
thanks Joe.
 
Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
You wanted something that will refresh your JSP page. Hmmm. I am giving a little code here. This JSP refreshes itself automatically every 5 seconds.



You can force refresh by this line :


So what you can do, is to reduce the refresh time and put in your page. So your JSP will always show the latest data.

Tell me if this helps.

Abhishek
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic