Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form validation

 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form is a jsp. When the user submits the form a servlet receives the data and validates it to ensure that the required fields have been entered. If they have, then it continues processing. If they haven't, the the servlet forwards control back to the form. I would like to have the valid data already entered into the form after the forward. Is there a way to do this? I have tried storing the form information in a java bean (with request scope), but I am not able to access the bean using the getAttribute method of HttpServletRequest.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to manually generate the data as part of the outgoing JSP.
This is one of the reasons why Struts has been gaining popularity - the Struts form control tags handle the job for you.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic