This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Updating DB from JSP  RSS feed

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , I have a table displaying data from a DB on a JSP page. Users can edit various fields on the table and submit the changes. Now I am having a bit of problem with submitting the changes and updating the DB , since I want to keep the jsp for displaying purposes only , I want to send the changed data back a servlet to actually update the DB.My question is what is the best way to send the changed data back to the servlet.
I mean suppose the original row was something like this



Now what would be the best way to send this data back to the servlet. I could create a map having the original row values and the new row values and pass that map to the servlet which will check for the changes and update the DB. Is this the proper way ?? Sugestions are always welcome

 
Author and ninkuma
Marshal
Posts: 66801
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to submit a request without refreshing the whole page then Ajax is the way to do it.
 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know i could use AJAX. Here i actually dont mind the entire page being redirected to a servlet so no need for AJAX. Since once the user is done making all the changes he clicks the update button and the DB gets updated. I am just a bit confused on the data structure or mechanism to use to send the changes to a servlet. Does my previous idea sound reasonable ??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66801
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You wording confused me, I thought you didn't want to submit the page.

All submission to the servlet should be normal request parameters as name/value pairs, so I'm not sure what you are asking beyond that?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!