struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musom...@aol.com
Subject Re: s2: Validation xml file not being used when validating a method
Date Wed, 18 Nov 2009 00:20:48 GMT

 I think the @OP's difficulty is with the name vs method attributes of the action element
so (if I may 
be excused for borrow Musachy's example) if you have 


<package name="survey" namespace="/survey" extends="struts-default">
        <action name="save" class="survey.SurveyAction" method="persist">
            <result>/survey/survey-results.jsp</result>
            <result name="input">/survey/survey.jsp</result>
        </action>
    </package>

then the action alias is save (and not persist)

 

Chris
 

 

-----Original Message-----
From: Musachy Barroso <musachy@gmail.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Tue, Nov 17, 2009 6:17 pm
Subject: Re: s2: Validation xml file not being used when validating a method










It can be done like that as well, but, your first attempt should be
better. The "alias" part is the action name, lets say you have an
action like this:

<package name="survey" namespace="/survey" extends="struts-default">
        <action name="save" class="survey.SurveyAction" method="save">
            <result>/survey/survey-results.jsp</result>
            <result name="input">/survey/survey.jsp</result>
        </action>
    </package>

you would need to name the validation file
"SurveyAction-save-validation.xml", and this file *has* to be in the
classpath of the application under "survey". Make sure that the
validation file is landing next to the action that it is supposed to
validate, in the web app classes dir.

musachy

On Tue, Nov 17, 2009 at 3:10 PM, ben_979 <benninesevennine@yahoo.ca> wrote:
>
> So it's done strictly by exclusion? I *thought* I had read that the
> validation could be focused on a specific method through the naming
> convention of the validation file(s). Is that idea totally wrong?
>
> --
> View this message in context: http://old.nabble.com/s2%3A-Validation-xml-file-not-being-used-when-validating-a-method-tp26399337p26399526.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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




 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message