• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

updating database records via jsp

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic