You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Session A Mwamufiya <sm...@andrew.cmu.edu> on 2007/08/13 08:58:05 UTC

Preventing validation when form is first displayed

Hi, I have an action that is validateable and uses the validate method to ensure that an element isn't added to the database if it already exists in there.  Unfortunately, the validation occurs as soon as my form is launched.  I tried to follow the approach from the helloworld example to not have this happen, but it doesn't work.  I would rather avoid using annotations for maintainability reasons.  Would someone give me directions to how to stop validation from occurring when the form is launched.

Thanks,


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


Re: Preventing validation when form is first displayed

Posted by Session A Mwamufiya <sm...@andrew.cmu.edu>.
I simply configured my default set of interceptors as follows:
<interceptor-ref name="validation" >
	<param name="excludeMethods">
		execute
	</param>
</interceptor-ref>
<interceptor-ref name="workflow" >
	<param name="excludeMethods">
		execute
	</param>
</interceptor-ref>

This makes sure that the validation doesn't occur when the action is initially fired.  You can add more methods to the list if you'd like to.

Session


> I use to have a loadAction for each page and the real action to post
> to... Maybe I didn't catch the problem, do you use that scheme?
> 
> 
> On 8/13/07, Session A Mwamufiya <sm...@andrew.cmu.edu> wrote:
>> 
>> Hi, I have an action that is validateable and uses the validate method
>> to ensure that an element isn't added to the database if it already
>> exists in there.  Unfortunately, the validation occurs as soon as my
>> form is launched.  I tried to follow the approach from the helloworld
>> example to not have this happen, but it doesn't work.  I would rather
>> avoid using annotations for maintainability reasons.  Would someone give
>> me directions to how to stop validation from occurring when the form is
>> launched.
>> 
>> Thanks,
>> 
>> 
>> --------------------------------------------------------------------- To
>> unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
>> commands, e-mail: user-help@struts.apache.org
>> 
>> 
> 
> 
> -- "Nada fija tan intensamente una cosa a la memoria como el deseo de 
> olvidarla." (Michel de Montaigne)
> 
> http://yayocaturas.blogspot.com/
> 


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


Re: Preventing validation when form is first displayed

Posted by Yayo <ed...@gmail.com>.
I use to have a loadAction for each page and the real action to post to...
Maybe I didn't catch the problem, do you use that scheme?


On 8/13/07, Session A Mwamufiya <sm...@andrew.cmu.edu> wrote:
>
> Hi, I have an action that is validateable and uses the validate method to
> ensure that an element isn't added to the database if it already exists in
> there.  Unfortunately, the validation occurs as soon as my form is
> launched.  I tried to follow the approach from the helloworld example to not
> have this happen, but it doesn't work.  I would rather avoid using
> annotations for maintainability reasons.  Would someone give me directions
> to how to stop validation from occurring when the form is launched.
>
> Thanks,
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Nada fija tan intensamente una cosa a la memoria como el deseo de
olvidarla." (Michel de Montaigne)

http://yayocaturas.blogspot.com/

Re: RE Preventing validation when form is first displayed

Posted by Session A Mwamufiya <sm...@andrew.cmu.edu>.
Great, thanks!  it worked.

Best,
Session


> Hi,
> 
> I had the same problem, and added in my struts.xml :
> 
> <interceptor-ref name="validation"> <param name="excludeMethods">execute, 
> input,back,cancel,browse, detail, delete, goAdd, goModif, view</param> 
> </interceptor-ref> <interceptor-ref name="workflow"> <param
> name="excludeMethods"> execute,input,back,cancel,browse, detail, delete,
> goAdd, goModif, view</ param> </interceptor-ref>
> 
> So add the name of your first method in the excludeMethods, and the 
> validation will not occures.
> 
> 
> 
> 
> 
> 
> "Session A Mwamufiya" <sm...@andrew.cmu.edu> 13/08/2007 08:58 Veuillez
> répondre à "Struts Users Mailing List" <us...@struts.apache.org>
> 
> 
> A user@struts.apache.org cc
> 
> Objet Preventing validation when form is first displayed
> 
> 
> 
> 
> 
> 
> Hi, I have an action that is validateable and uses the validate method to
>  ensure that an element isn't added to the database if it already exists
> in there.  Unfortunately, the validation occurs as soon as my form is 
> launched.  I tried to follow the approach from the helloworld example to 
> not have this happen, but it doesn't work.  I would rather avoid using 
> annotations for maintainability reasons.  Would someone give me
> directions to how to stop validation from occurring when the form is
> launched.
> 
> Thanks,
> 
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
> commands, e-mail: user-help@struts.apache.org
> 
> 
> 


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


RE Preventing validation when form is first displayed

Posted by ML...@abusinessware.com.
Hi,

I had the same problem, and added in my struts.xml :

<interceptor-ref name="validation">
                    <param name="excludeMethods">execute, 
input,back,cancel,browse, detail, delete, goAdd, goModif, view</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">
execute,input,back,cancel,browse, detail, delete, goAdd, goModif, view</
param>
                </interceptor-ref>

So add the name of your first method in the excludeMethods, and the 
validation will not occures.






"Session A Mwamufiya" <sm...@andrew.cmu.edu> 
13/08/2007 08:58
Veuillez répondre à
"Struts Users Mailing List" <us...@struts.apache.org>


A
user@struts.apache.org
cc

Objet
Preventing validation when form is first displayed






Hi, I have an action that is validateable and uses the validate method to 
ensure that an element isn't added to the database if it already exists in 
there.  Unfortunately, the validation occurs as soon as my form is 
launched.  I tried to follow the approach from the helloworld example to 
not have this happen, but it doesn't work.  I would rather avoid using 
annotations for maintainability reasons.  Would someone give me directions 
to how to stop validation from occurring when the form is launched.

Thanks,


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