Struts: How do I validate data from an edit form?

S

Stefan

Hello!

In my Struts app - after submit - I want to validate fields that were
filled with values from a database beforehand. To fill the fields with
the old values I write the existing data into a bean and use it in my
JSP as follows:

<jsp:useBean id="formData" scope="request" class="com.xyz"/>

<html:text name="formData" property="test"/>

So far so good.

When a validation error occurs the user is redirected to the same JSP.

The problem now is that the fields are empty because the bean defined
in the JSP doesn't exist anymore. In fact I actually don't want this
bean to be used. The form-bean which is containing the new data should
be used.

How can I acchieve that?

Regards,
Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top