You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by robinbajaj <ro...@gmail.com> on 2007/05/29 00:09:36 UTC

[s2] logon-validation.xml does not work in

I am a Struts 2 newbie. The validation piece from Struts 2 bootstrap tutorial
is
not kicking in, and does not show the validation error messages even when I
provide invalid data.

I started my this struts2 project using the the Maven Starter Archetype
(struts2-archetype-starter)
and my Logon-validation.xml is located src/main/resources folder, which gets
copied in Web-inf/classes folder on deployment (done through mvn jetty:run). 

I am trying to following this link from Struts2 bootstrap tutorial 
http://struts.apache.org/2.x/docs/validating-input.html

and have an issue at the Validation Input piece. 

I have created my Logon.java (my action), my logon.jsp and correctly mapped
them in struts.xml

Here's my struts.xml code.
http://rafb.net/p/KG8ELQ25.html

Here's my Logon.java
http://rafb.net/p/vNR89E61.html

Here's my Logon.jsp
http://rafb.net/p/rOZl5r57.html

Here's my Logon-Validation.xml
http://rafb.net/p/FToVf186.html

I give in empty username and password and hit submit, and get returned to
the Logon.jsp without showing the error messages. Can someone please point
out what's wrong. ??


-- 
View this message in context: http://www.nabble.com/-s2--logon-validation.xml-does-not-work-in-tf3830792.html#a10845117
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


Re: [s2] Validation does not work in Struts 2 basic project

Posted by Olivier THIERRY <ol...@gmail.com>.
Well, I still couldn't succeed in implementing validation with Struts 2, so
I can't help you :(


2007/5/29, Vijay Prajapati <vi...@gmail.com>:
>
> Hi Olivier,
>      I am using Struts2.0.6 and trying to implement Validator framework
> but
> couldn't succeed. I have confution to give name of
> actionname-validator.xmlfile.
> I am here giving action cofiguration in Struts.xml
>
> <action name="*UserManagementAction" method="{1}" class="
> com.realsoftinc.appcentral.web.user.UserManagementAction">
> <interceptor-ref name="validationWorkflowStack" />
> <result name="success">/adduser.jsp</result>
> <result name="input">/adduser.jsp</result>
> </action>
> I have implemented UserManagementAction.java with 4
> methods(addNew,Update,delete,execute) which return SUCCESS and INPUT. In
> that i want validation in only 2 methods(addNew,Update).
>
> If i would create UserManagementAction-validation.xml then validation is
> executed for all 4 methods. but if i would create
> UserManagementAction-addNew-validation.xml then it is not executed for
> addNew method.
>
> In my JSP there are 3 submit button with assigned method named
> addNew,Update,delete.
>
> So what should i do to execute validation for addNew and Update method?
>
> Please Help me to solve this problem.
>
> Vijay Prajapati
>
>
>
> On 5/29/07, Olivier THIERRY <ol...@gmail.com> wrote:
> >
> > I think you have to add validation interceptor to your action.
> >
> > Try something like that :
> >
> > <action name="Logon_*" method="{1}" class="tutorial.Logon">
> >            <interceptor-ref name="validationWorkflowStack" />
> >                        <result type="redirect-action">Menu</result>
> >                        <result name="input">/jsp/Logon.jsp</result>
> >
> >                </action>
> >
> >
> > Hope it helps ;)
> >
> > 2007/5/29, robinbajaj <ro...@gmail.com>:
> > >
> > >
> > > <sorry, reposting my previous message with more  appropriate subject
> > line
> > > >
> > >
> > > I am a Struts 2 newbie. The validation piece from Struts 2 bootstrap
> > > tutorial is
> > > not kicking in, and does not show the validation error messages even
> > when
> > > I
> > > provide invalid data.
> > >
> > > I started my this struts2 project using the the Maven Starter
> Archetype
> > > (struts2-archetype-starter)
> > > and my Logon-validation.xml is located src/main/resources folder,
> which
> > > gets
> > > copied in Web-inf/classes folder on deployment (done through mvn
> > > jetty:run).
> > >
> > > I am trying to following this link from Struts2 bootstrap tutorial
> > > http://struts.apache.org/2.x/docs/validating-input.html
> > >
> > > and have an issue at the Validation Input piece.
> > >
> > > I have created my Logon.java (my action), my logon.jsp and correctly
> > > mapped
> > > them in struts.xml
> > >
> > > Here's my struts.xml code.
> > > http://rafb.net/p/KG8ELQ25.html
> > >
> > > Here's my Logon.java
> > > http://rafb.net/p/vNR89E61.html
> > >
> > > Here's my Logon.jsp
> > > http://rafb.net/p/rOZl5r57.html
> > >
> > > Here's my Logon-Validation.xml
> > > http://rafb.net/p/FToVf186.html
> > >
> > > I give in empty username and password and hit submit, and get returned
> > to
> > > the Logon.jsp without showing the error messages. Can someone please
> > point
> > > out what's wrong. ??
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://www.nabble.com/-s2--Validation-does-not-work-in-Struts-2-basic-project-tf3830792.html#a10845117
> > > 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
> > >
> > >
> >
>

Re: [s2] Validation does not work in Struts 2 basic project

Posted by Vijay Prajapati <vi...@gmail.com>.
Hi Olivier,
     I am using Struts2.0.6 and trying to implement Validator framework but
couldn't succeed. I have confution to give name of
actionname-validator.xmlfile.
 I am here giving action cofiguration in Struts.xml

<action name="*UserManagementAction" method="{1}" class="
com.realsoftinc.appcentral.web.user.UserManagementAction">
<interceptor-ref name="validationWorkflowStack" />
<result name="success">/adduser.jsp</result>
<result name="input">/adduser.jsp</result>
</action>
I have implemented UserManagementAction.java with 4
methods(addNew,Update,delete,execute) which return SUCCESS and INPUT. In
that i want validation in only 2 methods(addNew,Update).

If i would create UserManagementAction-validation.xml then validation is
executed for all 4 methods. but if i would create
UserManagementAction-addNew-validation.xml then it is not executed for
addNew method.

In my JSP there are 3 submit button with assigned method named
addNew,Update,delete.

So what should i do to execute validation for addNew and Update method?

Please Help me to solve this problem.

Vijay Prajapati



On 5/29/07, Olivier THIERRY <ol...@gmail.com> wrote:
>
> I think you have to add validation interceptor to your action.
>
> Try something like that :
>
> <action name="Logon_*" method="{1}" class="tutorial.Logon">
>            <interceptor-ref name="validationWorkflowStack" />
>                        <result type="redirect-action">Menu</result>
>                        <result name="input">/jsp/Logon.jsp</result>
>
>                </action>
>
>
> Hope it helps ;)
>
> 2007/5/29, robinbajaj <ro...@gmail.com>:
> >
> >
> > <sorry, reposting my previous message with more  appropriate subject
> line
> > >
> >
> > I am a Struts 2 newbie. The validation piece from Struts 2 bootstrap
> > tutorial is
> > not kicking in, and does not show the validation error messages even
> when
> > I
> > provide invalid data.
> >
> > I started my this struts2 project using the the Maven Starter Archetype
> > (struts2-archetype-starter)
> > and my Logon-validation.xml is located src/main/resources folder, which
> > gets
> > copied in Web-inf/classes folder on deployment (done through mvn
> > jetty:run).
> >
> > I am trying to following this link from Struts2 bootstrap tutorial
> > http://struts.apache.org/2.x/docs/validating-input.html
> >
> > and have an issue at the Validation Input piece.
> >
> > I have created my Logon.java (my action), my logon.jsp and correctly
> > mapped
> > them in struts.xml
> >
> > Here's my struts.xml code.
> > http://rafb.net/p/KG8ELQ25.html
> >
> > Here's my Logon.java
> > http://rafb.net/p/vNR89E61.html
> >
> > Here's my Logon.jsp
> > http://rafb.net/p/rOZl5r57.html
> >
> > Here's my Logon-Validation.xml
> > http://rafb.net/p/FToVf186.html
> >
> > I give in empty username and password and hit submit, and get returned
> to
> > the Logon.jsp without showing the error messages. Can someone please
> point
> > out what's wrong. ??
> >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/-s2--Validation-does-not-work-in-Struts-2-basic-project-tf3830792.html#a10845117
> > 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
> >
> >
>

Re: [s2] Validation does not work in Struts 2 basic project

Posted by Olivier THIERRY <ol...@gmail.com>.
I think you have to add validation interceptor to your action.

Try something like that :

<action name="Logon_*" method="{1}" class="tutorial.Logon">
            <interceptor-ref name="validationWorkflowStack" />
			<result type="redirect-action">Menu</result>
			<result name="input">/jsp/Logon.jsp</result>

		</action>


Hope it helps ;)

2007/5/29, robinbajaj <ro...@gmail.com>:
>
>
> <sorry, reposting my previous message with more  appropriate subject line
> >
>
> I am a Struts 2 newbie. The validation piece from Struts 2 bootstrap
> tutorial is
> not kicking in, and does not show the validation error messages even when
> I
> provide invalid data.
>
> I started my this struts2 project using the the Maven Starter Archetype
> (struts2-archetype-starter)
> and my Logon-validation.xml is located src/main/resources folder, which
> gets
> copied in Web-inf/classes folder on deployment (done through mvn
> jetty:run).
>
> I am trying to following this link from Struts2 bootstrap tutorial
> http://struts.apache.org/2.x/docs/validating-input.html
>
> and have an issue at the Validation Input piece.
>
> I have created my Logon.java (my action), my logon.jsp and correctly
> mapped
> them in struts.xml
>
> Here's my struts.xml code.
> http://rafb.net/p/KG8ELQ25.html
>
> Here's my Logon.java
> http://rafb.net/p/vNR89E61.html
>
> Here's my Logon.jsp
> http://rafb.net/p/rOZl5r57.html
>
> Here's my Logon-Validation.xml
> http://rafb.net/p/FToVf186.html
>
> I give in empty username and password and hit submit, and get returned to
> the Logon.jsp without showing the error messages. Can someone please point
> out what's wrong. ??
>
>
> --
> View this message in context:
> http://www.nabble.com/-s2--Validation-does-not-work-in-Struts-2-basic-project-tf3830792.html#a10845117
> 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
>
>

Re: [s2] logon-validation.xml does not work in

Posted by Dave Newton <ne...@yahoo.com>.
--- robinbajaj <ro...@gmail.com> wrote:
> Here's my Logon-Validation.xml
> http://rafb.net/p/FToVf186.html

Is it really Logon-Validation.xml (capital "V")? Or is
it really Logon-validaiton.xml (misspelled) like on
nopaste? Or is it logon-validation.xml like in the
subject? Or is it actually spelled correctly? 

Why do you have the "isInvalid" stuff in there? 

Is Logon-validation.xml in the right classpath?

d.



       
____________________________________________________________________________________Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

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