You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rajiv verma <ra...@gmail.com> on 2005/09/08 20:55:09 UTC

Action based validations

I am using struts 1.2 and my client side validations using based on action 
rather than form are not working? Is there a bug in the 1.2 release. I have 
worked previously with 1.1 and it used to work just fine.
In the validation file,
instead of 
 
<form name="accountForm">

I could use

<form name="/accountAction">

Any clues??

-Rajiv

Re: Action based validations

Posted by Joe Germuska <Jo...@Germuska.com>.
At 2:55 PM -0400 9/8/05, rajiv verma wrote:
>I am using struts 1.2 and my client side validations using based on action
>rather than form are not working? Is there a bug in the 1.2 release. I have
>worked previously with 1.1 and it used to work just fine.
>In the validation file,
>instead of
>
><form name="accountForm">
>
>I could use
>
><form name="/accountAction">

If you have simply upgraded versions of Struts, this should not have 
broken; however, you may have run into one of the most unfortunate 
naming mistakes in Struts (probably worse than ActionErrors and 
ActionMessages!)

Struts provides several varieties of validation ActionForm classes 
which integrate with the commons-validator framework.  The only 
difference between these varieties is the key which they use to 
lookup validation rules.   Some use the name of the form bean, others 
use the action path

This wiki page attempts to explain some of the differences: 
http://wiki.apache.org/struts/ValidatorActionForms

Also, Niall's change of April, 2004 now enables other users to easily 
subclass Validator Form to use any variety of strategies to determine 
the validator rules key. 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=28150)

Hope this helps.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action based validations

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
rajiv verma on 08/09/05 19:55, wrote:
> I am using struts 1.2 and my client side validations using based on action 
> rather than form are not working? Is there a bug in the 1.2 release. I have 
> worked previously with 1.1 and it used to work just fine.
> In the validation file,
> instead of 
>  
> <form name="accountForm">
> 
> I could use
> 
> <form name="/accountAction">
> 
> Any clues??


Rajiv,
shooting from the hip, I'd recommend you check that you have the latest 
version of commons-validator, or rather the correct version of validator 
for what you want to do.

Have you read up on the latest validator functionality? I suspect that 
it may have changed and that this behaviour with actions has been 
superceded. But that's a wild wild guess, it's been over a year since I 
worked with it myself.


Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org