Mufaddal Khumri wrote:
Hi,
Lets say I have an action and some of the properties being set on that
action are to be validated which I can do a number of ways. Is there a
way in Struts2 to tell the system not to valid the framework the first
time the action is accessed:
[Turn validation off]
http://mydomain.com/wizard/mytest.action
The above page has a form with two fields param1 and param2. When I
click submit this form gets submitted to:
[Turn validation on]
http://mydomain.com/wizard/mytest.action
This time if param1 and param2 were not specified. The user is taken
back to INPUT and they see the error message.
Is the above possible in some Struts2 way of doing things?
Yes, with some fiddling. You need to arrange for the form submission to
call a different method in the action than the form retrieval, then tie
your validation to that. The easiest way would be to include a
method="something" attribute on the form's s:submit tag. You'll probably
need to tweak the validation interceptor configuration to turn
validation off for the action's execute() method (or use annotations).
But you certainly can achieve the effect.
If you need more help with the specifics, post again with more detail
about your exact requirements so you'll get the most appropriate
directions.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]