Matt wrote:
> I had been using the value property of the struts-html
> tags to fill in the data, but I've noticed that when
> the user hits submit, if there is a validation error,
> they are pushed back to the page, and the data they
> had enetered is replaced with what was in the DTO
> (which is now old data).

Don't use the 'value' attribute, just let Struts render the HTML form
elements based on what's stored in the Form bean.  That will fix the
redisplay on validation problem.

If you need to pre-populate the form, read the DTO from the database and use
BeanUtils.copyProperties(...) to copy the DTO values into the Form bean
before forwarding to the view.

Take a look at the struts-example webapp, it works the way you're
describing.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 

Reply via email to