Ok to make my self clear I have three field to check name,email and message.
I want name and message to be required but email required complex
validation that is not provided with struts.
As 'required' is provided in Struts I can set validation rule for name
and message simply in xml file.
And i want to write validation rule for email in validate() method.
Is that possible?
Also one step further can i define rule for name and message in
validate() method also?
Field Validation
-------------------------------
Name Required
Email Complex
Message Required
Option 1:
-------------
In .xml file
<rule for name required/>
<rule for message required/>
and in validate() method
{ //rule for email check }
Option 2:
-------------
In .xml file
<rule for name required/>
<rule for message required/>
and in validate() method
{// rule for name required }
{// rule for message required}
{// rule for email check }
If both option is not possible what can I do?
Anjib
On 12/28/2010 1:27 PM, Paul Benedict wrote:
Anjib,
It depends on how you configure your struts action. If you have
validate="true" on, then no -- failed validation will never make it to your
action. If you want to call validate() yourself in execute() and perform
additional validation, go for it.
Paul
On Tue, Dec 28, 2010 at 12:20 PM, Anjib Mulepati<anji...@hotmail.com>wrote:
Struts 1.3.8
Can I use validate.xml and validate() method at same time
a) for same field in both place and
b) different disjunctive fields.
Anjib
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org