Michael coincidentally enough the last few threads have addressed the same issue. To 
summarize you could do one of two things:

1. Define 2 identical action-mappings in your struts-config
- Call the first one "firstVisitSomething...Action" and set validate=false
Now when a user clicks on the link to go to your page for the first time you go here.

- The second action-mapping will have validate=true, and your form action in your jsp 
will post to this action-mapping

2. The other way to do it is to set validate=false in your action mapping, then call 
form.validate() in your Action object when the mode is "submit" or some such.


-----Original Message-----
From: Michael J. Godfrey [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 4:16 PM
To: Struts (E-mail)
Subject: validation="true"


Greetings,
        I am just starting to write a test app to learn struts.
I have a validation="true" setting in struts-config.xml.

When this is true, the validation happens when I OPEN a page.
I have validation that is checking for existance of values, etc.
For example.
A login page with loginID, and password as fields.
In the validate() I am checking for loginID == null and loginID.length()
<1 etc etc.
This is failing right out of the chute because the validation is firing
when the darn thing loads.
What am I doing wrong?
I have read the jakarta FAQ's etc stating that low budget validation
SHOULD be done in validate().
-Michael

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to