This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes form validation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "form validation" Watch "form validation" New topic
Author

form validation

Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
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.


Matthew Phillips
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14491
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Thanks Tim.
 
 
subject: form validation
 
Similar Threads
How to access Bean
how to make use javabean in struts ?
use bean instance in servlet
html file with multiple form elements
Servlet - EJB - JSP