File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintain Data Across Errors

 
Dave Wingate
Ranch Hand
Posts: 262
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if anyone could suggest a good strategy for maintaining user entered data across, say, validation errors.

My goal is that when a user submits a form to a servlet and something goes wrong, I would like to redisplay the page that the user submitted the form from. I can accomplish this through response.sendRedirect(), but the user's data is gone. It appears that I have a new request object when I use sendRedirect().

Is there a good way to maintain the user's submitted data across multiple invocations of the same JSP?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than a redirect, perform a dispatcher forward and the submitted parameter values will be available when re-building the page.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic