struts and form validation

S

Scott Phelps

I have two forms that I submit both do validation, one keeps the form
entries on errors one does not.

The only thing that I can see that is different (maybe im doing something
wrong) is that I load a bean in one and not another.

ie
first one that does not keep entries on errors

<html:form action="/entry" name="curr" type="org.my.struts..myForm">


the other that does

<html:form action="/entry">

How do I make the first keep form entries on errors, and still be able to
load entries from the session?

Thanks
 
W

Wendy Smoak

Scott Phelps said:
I have two forms that I submit both do validation, one keeps the form
entries on errors one does not.

What do the <action> mappings in struts-config.xml look like?
I'm guessing that one has session scope, and the other, request scope.
 
S

Scott Phelps

Wendy Smoak said:
What do the <action> mappings in struts-config.xml look like?
I'm guessing that one has session scope, and the other, request scope.

No they are both session. Could the differenct be that one is using a bean
to populate the fields, the other is not? but even so wouldn't the fields be
popluated on the finding of the error?

Thanks
 
W

Wendy S

Scott Phelps said:
No they are both session. Could the differenct be that one is using a bean
to populate the fields, the other is not? but even so wouldn't the fields
be popluated on the finding of the error?

They're both using a bean to populate the fields... one is using the form
bean that [I assume] you configured in struts-config.xml, and the other is
using the one that you put in the <html:form> tag.

Without seeing the <action> mappings from struts-config, it's a waste of
time for me to keep guessing. Also, what URLs are you visiting to view the
forms? Are you doing anything interesting in the Action code?
 

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

Similar Threads

Responsive form 0
Struts 3
Struts and Form validation 0
JSP Form validation 1
Struts - Lazy Validator Form 0
Login form no longer working 2
Struts update form validation 1
Struts validation 0

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top