Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

struts and form validation

Thread view: 
Scott Phelps - 04 May 2005 21:52 GMT
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
Wendy Smoak - 04 May 2005 22:00 GMT
> 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.

Signature

Wendy S

Scott Phelps - 06 May 2005 16:37 GMT
>> 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.

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
Wendy S - 07 May 2005 05:35 GMT
> "Scott Phelps" <dontbother@hotmail.com> wrote:
>
> 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?

Signature

Wendy



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.