You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ylva Degerfeldt <yl...@gmail.com> on 2008/08/14 17:42:29 UTC
[S2]Validation with xml file not working
Hi everyone,
I'm trying to use the Validation framework by creating a file called
NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
it's not working the way it should.
I've stepped through the code and it seems that the validations that
should have been made through the xml file just don't happen.
When, for instance, I've tried to deliberately leave some fields empty
(which the validator should have noticed), the execute method is still
invoked. This shouldn't happen when there are validation errors,
right?
I've put the validation xml file in the same directory (and package)
as the corresponding action, but it seems that Struts 2 can't find it
anyway. What am I doing wrong?
This is the declaration of my action in struts.xml:
.....
<action name = "NameAndCvAction" class = "Web.StrutsActions.NameAndCvAction">
<result>/showSkills.jsp</result>
<result name = "input">/NameAndCv.jsp</result>
</action>
....
(This belongs to a package that extends struts-default)
By the way, I'm also using simple validation which works without
problems. (But I'd like to know how to use the validation framework
"the harder way" too.)
Can somebody please help me?
Thanks in advance!
/Ylva
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2]Validation with xml file not working
Posted by Lukasz Lenart <lu...@googlemail.com>.
Did you check also the deployment, on the server? Eclipse will not
copy other files then Java classes when you will deploy. Check if xml
file is in the same package after deploy to the server.
Regards
--
Lukasz
http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2]Validation with xml file not working
Posted by Ylva Degerfeldt <yl...@gmail.com>.
Ok, I found it. But (as the book said) , "validation" comes before
"workflow" in the "validationWorkflowStack", so there has to be some
other explanation for the exception.
/Ylva
On Fri, Aug 15, 2008 at 1:59 PM, Torsten Krah
<tk...@fachschaft.imn.htwk-leipzig.de> wrote:
> Am Freitag, 15. August 2008 00:22:01 schrieb Stephan Schröder:
>> i don't know which interceptors are on your default stack. Does 'workflow'
>> come after 'validation'?
>
> Look into struts-default.xml in the struts-2.x.jar file, there you can see all
> stacks defined with their interceptors.
>
> --
> Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
> Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
>
> Really, I'm not out to destroy Microsoft. That will just be a
> completely unintentional side effect."
> -- Linus Torvalds
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2]Validation with xml file not working
Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Am Freitag, 15. August 2008 00:22:01 schrieb Stephan Schröder:
> i don't know which interceptors are on your default stack. Does 'workflow'
> come after 'validation'?
Look into struts-default.xml in the struts-2.x.jar file, there you can see all
stacks defined with their interceptors.
--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
-- Linus Torvalds
Re: RE: [S2]Validation with xml file not working
Posted by Stephan Schröder <si...@gmx.de>.
> Stephan, are you getting this exception ("URI is not hierarchical") too?
actually i did, i just checked the logs (catalina.out). But the last time was on July 22th.
But i have some more straight forward errors now:
Caught exception while loading file actions/security/Login-register-validation.xml
www.opensymphony.com - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)
...
Caused by: java.net.UnknownHostException: www.opensymphony.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
...
Important Information: when i tested the webapp on my laptop the laptop wasn't online (local Tomcat6) :-)
So does that mean validation will always fail when the server has no internet connection?! Probably because it tries to check if the xml-file is well formed and fails to get the DTD? What could be done as workaround for this problem?
/Stephan
-------- Original-Nachricht --------
> Datum: Fri, 15 Aug 2008 13:02:20 +0200
> Von: "Ylva Degerfeldt" <yl...@gmail.com>
> An: "Struts Users Mailing List" <us...@struts.apache.org>
> Betreff: Re: RE: [S2]Validation with xml file not working
> About the interceptors on the default stack I don't know how to check
> that since it's built in. But "Struts in Action" says that in the
> struts-default.xml, the validation interceptor comes before the
> workflow interceptor. And I don't think that's the problem anyway
> since simple validation is working.
>
> It's just this weird "URI is not hierarchical" exception which happens
> (among other places) in ValidatorFactory.parseValidators
>
> Anyone who has any ideas why this is happening?
>
> Stephan, are you getting this exception too?
>
> /Ylva
>
> On Fri, Aug 15, 2008 at 10:15 AM, "Stephan Schröder" <si...@gmx.de>
> wrote:
> >
> > actually, now i have the same problem (or a variation of it) :-)
> >
> > I develop under Vista with eclipse. When i deploy the webapp from
> eclipse (to Tomcat6) validation works fine. But when i export to war-file and
> deploy it on my xubuntu laptop with Tomcat6, validation is omitted. The
> validation-files are present in the war-file. Could this be because of a
> different xml file encoding? (On vista it's UTF8. I have no idea what Tomcat6
> expects but UTF8 sounds reasonable.)
> >
> > -------- Original-Nachricht --------
> >> Datum: Thu, 14 Aug 2008 18:38:02 -0700 (PDT)
> >> Von: Dave Newton <ne...@yahoo.com>
> >> An: Struts Users Mailing List <us...@struts.apache.org>
> >> Betreff: RE: [S2]Validation with xml file not working
> >
> >> I think he was asking the original poster if *his* stack included those
> >> interceptors in the correct order, since it's his validation that isn't
> >> working properly.
> >>
> >> Dave
> >>
> >> --- On Thu, 8/14/08, Martin Gainty <mg...@hotmail.com> wrote:
> >> > yes .. vanilla config from struts-default.xml
> >> >
> >> > <!-- Sample validation and workflow stack -->
> >> > <interceptor-stack
> >> > name="validationWorkflowStack">
> >> > <interceptor-ref
> >> > name="basicStack"/>
> >> > <interceptor-ref
> >> > name="validation"/>
> >> > <interceptor-ref
> >> > name="workflow"/>
> >> > </interceptor-stack>
> >> >
> >> > HTH
> >> > Martin
> >> >
> >> >
> >> > > Date: Fri, 15 Aug 2008 00:22:01 +0200
> >> > > From: simon.void@gmx.de
> >> > > Subject: Re: [S2]Validation with xml file not working
> >> > > To: user@struts.apache.org
> >> > >
> >> > > > What could it be?
> >> > >
> >> > > i don't know which interceptors are on your
> >> > default stack. Does 'workflow' come after
> >> > 'validation'?
> >> > >
> >> > > /Stephan
> >> > >
> >> > > -------- Original-Nachricht --------
> >> > > > Datum: Thu, 14 Aug 2008 18:20:33 +0200
> >> > > > Von: "Ylva Degerfeldt"
> >> > <yl...@gmail.com>
> >> > > > An: "Struts Users Mailing List"
> >> > <us...@struts.apache.org>
> >> > > > Betreff: Re: [S2]Validation with xml file not
> >> > working
> >> > >
> >> > > > Lukasz, I'm not sure how to check the
> >> > deployment but I was thinking
> >> > > > that too. (I'm using NetBeans 5.5.1 and Sun
> >> > App. server.)
> >> > > >
> >> > > > André, it's funny you should mention that
> >> > because I just changed the
> >> > > > name From .....-validation.xml to
> >> > ....-validations.xml because they
> >> > > > must have misspelled it in one place in the
> >> > "Struts 2 in Action" book,
> >> > > > so I thought that was the correct way since the
> >> > name without the s
> >> > > > gives me this exception:
> >> > > >
> >> > > > java.lang.IllegalArgumentException: URI is not
> >> > hierarchical
> >> > > >
> >> > > > At least I know it has nothing to do with that
> >> > I'm uploading a file
> >> > > > from a form, 'cause that part works fine.
> >> > It's something about the
> >> > > > validation. What could it be?
> >> > > >
> >> > > > /y
> >> > > >
> >> > > > On Thu, Aug 14, 2008 at 6:04 PM, André Cedik |
> >> > GDG
> >> > > > <a....@german-digital-group.de> wrote:
> >> > > > > Maybe it's just because of the
> >> > misspelling.
> >> > > > > If you'd like to do validation this way,
> >> > > > > your xml-file should be named
> >> > > > > "NameAndCvAction-validation.xml"
> >> > without
> >> > > > > the "s" at the end.
> >> > > > >
> >> > > > >
> >> > > > > Ylva Degerfeldt wrote:
> >> > > > >> Hi everyone,
> >> > > > >>
> >> > > > >> I'm trying to use the Validation
> >> > framework by creating a file called
> >> > > > >> NameAndCvAction-validations.xml, for my
> >> > action "NameAndCvAction", but
> >> > > > >> it's not working the way it should.
> >> > > > >> I've stepped through the code and it
> >> > seems that the validations that
> >> > > > >> should have been made through the xml
> >> > file just don't happen.
> >> > > > >>
> >> > > > >> When, for instance, I've tried to
> >> > deliberately leave some fields empty
> >> > > > >> (which the validator should have
> >> > noticed), the execute method is still
> >> > > > >> invoked. This shouldn't happen when
> >> > there are validation errors,
> >> > > > >> right?
> >> > > > >>
> >> > > > >> I've put the validation xml file in
> >> > the same directory (and package)
> >> > > > >> as the corresponding action, but it
> >> > seems that Struts 2 can't find it
> >> > > > >> anyway. What am I doing wrong?
> >> > > > >>
> >> > > > >> This is the declaration of my action in
> >> > struts.xml:
> >> > > > >> .....
> >> > > > >> <action name =
> >> > "NameAndCvAction" class =
> >> > > > "Web.StrutsActions.NameAndCvAction">
> >> > > > >>
> >> > <result>/showSkills.jsp</result>
> >> > > > >> <result name =
> >> > "input">/NameAndCv.jsp</result>
> >> > > > >> </action>
> >> > > > >> ....
> >> > > > >> (This belongs to a package that extends
> >> > struts-default)
> >> > > > >>
> >> > > > >> By the way, I'm also using simple
> >> > validation which works without
> >> > > > >> problems. (But I'd like to know how
> >> > to use the validation framework
> >> > > > >> "the harder way" too.)
> >> > > > >>
> >> > > > >> Can somebody please help me?
> >> > > > >>
> >> > > > >> Thanks in advance!
> >> > > > >>
> >> > > > >> /Ylva
> >
> >
> >
> > --
> > GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry
> Passion!
> >
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
> >
> > ---------------------------------------------------------------------
> > 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
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: RE: [S2]Validation with xml file not working
Posted by Ylva Degerfeldt <yl...@gmail.com>.
About the interceptors on the default stack I don't know how to check
that since it's built in. But "Struts in Action" says that in the
struts-default.xml, the validation interceptor comes before the
workflow interceptor. And I don't think that's the problem anyway
since simple validation is working.
It's just this weird "URI is not hierarchical" exception which happens
(among other places) in ValidatorFactory.parseValidators
Anyone who has any ideas why this is happening?
Stephan, are you getting this exception too?
/Ylva
On Fri, Aug 15, 2008 at 10:15 AM, "Stephan Schröder" <si...@gmx.de> wrote:
>
> actually, now i have the same problem (or a variation of it) :-)
>
> I develop under Vista with eclipse. When i deploy the webapp from eclipse (to Tomcat6) validation works fine. But when i export to war-file and deploy it on my xubuntu laptop with Tomcat6, validation is omitted. The validation-files are present in the war-file. Could this be because of a different xml file encoding? (On vista it's UTF8. I have no idea what Tomcat6 expects but UTF8 sounds reasonable.)
>
> -------- Original-Nachricht --------
>> Datum: Thu, 14 Aug 2008 18:38:02 -0700 (PDT)
>> Von: Dave Newton <ne...@yahoo.com>
>> An: Struts Users Mailing List <us...@struts.apache.org>
>> Betreff: RE: [S2]Validation with xml file not working
>
>> I think he was asking the original poster if *his* stack included those
>> interceptors in the correct order, since it's his validation that isn't
>> working properly.
>>
>> Dave
>>
>> --- On Thu, 8/14/08, Martin Gainty <mg...@hotmail.com> wrote:
>> > yes .. vanilla config from struts-default.xml
>> >
>> > <!-- Sample validation and workflow stack -->
>> > <interceptor-stack
>> > name="validationWorkflowStack">
>> > <interceptor-ref
>> > name="basicStack"/>
>> > <interceptor-ref
>> > name="validation"/>
>> > <interceptor-ref
>> > name="workflow"/>
>> > </interceptor-stack>
>> >
>> > HTH
>> > Martin
>> >
>> >
>> > > Date: Fri, 15 Aug 2008 00:22:01 +0200
>> > > From: simon.void@gmx.de
>> > > Subject: Re: [S2]Validation with xml file not working
>> > > To: user@struts.apache.org
>> > >
>> > > > What could it be?
>> > >
>> > > i don't know which interceptors are on your
>> > default stack. Does 'workflow' come after
>> > 'validation'?
>> > >
>> > > /Stephan
>> > >
>> > > -------- Original-Nachricht --------
>> > > > Datum: Thu, 14 Aug 2008 18:20:33 +0200
>> > > > Von: "Ylva Degerfeldt"
>> > <yl...@gmail.com>
>> > > > An: "Struts Users Mailing List"
>> > <us...@struts.apache.org>
>> > > > Betreff: Re: [S2]Validation with xml file not
>> > working
>> > >
>> > > > Lukasz, I'm not sure how to check the
>> > deployment but I was thinking
>> > > > that too. (I'm using NetBeans 5.5.1 and Sun
>> > App. server.)
>> > > >
>> > > > André, it's funny you should mention that
>> > because I just changed the
>> > > > name From .....-validation.xml to
>> > ....-validations.xml because they
>> > > > must have misspelled it in one place in the
>> > "Struts 2 in Action" book,
>> > > > so I thought that was the correct way since the
>> > name without the s
>> > > > gives me this exception:
>> > > >
>> > > > java.lang.IllegalArgumentException: URI is not
>> > hierarchical
>> > > >
>> > > > At least I know it has nothing to do with that
>> > I'm uploading a file
>> > > > from a form, 'cause that part works fine.
>> > It's something about the
>> > > > validation. What could it be?
>> > > >
>> > > > /y
>> > > >
>> > > > On Thu, Aug 14, 2008 at 6:04 PM, André Cedik |
>> > GDG
>> > > > <a....@german-digital-group.de> wrote:
>> > > > > Maybe it's just because of the
>> > misspelling.
>> > > > > If you'd like to do validation this way,
>> > > > > your xml-file should be named
>> > > > > "NameAndCvAction-validation.xml"
>> > without
>> > > > > the "s" at the end.
>> > > > >
>> > > > >
>> > > > > Ylva Degerfeldt wrote:
>> > > > >> Hi everyone,
>> > > > >>
>> > > > >> I'm trying to use the Validation
>> > framework by creating a file called
>> > > > >> NameAndCvAction-validations.xml, for my
>> > action "NameAndCvAction", but
>> > > > >> it's not working the way it should.
>> > > > >> I've stepped through the code and it
>> > seems that the validations that
>> > > > >> should have been made through the xml
>> > file just don't happen.
>> > > > >>
>> > > > >> When, for instance, I've tried to
>> > deliberately leave some fields empty
>> > > > >> (which the validator should have
>> > noticed), the execute method is still
>> > > > >> invoked. This shouldn't happen when
>> > there are validation errors,
>> > > > >> right?
>> > > > >>
>> > > > >> I've put the validation xml file in
>> > the same directory (and package)
>> > > > >> as the corresponding action, but it
>> > seems that Struts 2 can't find it
>> > > > >> anyway. What am I doing wrong?
>> > > > >>
>> > > > >> This is the declaration of my action in
>> > struts.xml:
>> > > > >> .....
>> > > > >> <action name =
>> > "NameAndCvAction" class =
>> > > > "Web.StrutsActions.NameAndCvAction">
>> > > > >>
>> > <result>/showSkills.jsp</result>
>> > > > >> <result name =
>> > "input">/NameAndCv.jsp</result>
>> > > > >> </action>
>> > > > >> ....
>> > > > >> (This belongs to a package that extends
>> > struts-default)
>> > > > >>
>> > > > >> By the way, I'm also using simple
>> > validation which works without
>> > > > >> problems. (But I'd like to know how
>> > to use the validation framework
>> > > > >> "the harder way" too.)
>> > > > >>
>> > > > >> Can somebody please help me?
>> > > > >>
>> > > > >> Thanks in advance!
>> > > > >>
>> > > > >> /Ylva
>
>
>
> --
> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>
> ---------------------------------------------------------------------
> 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: RE: [S2]Validation with xml file not working
Posted by Stephan Schröder <si...@gmx.de>.
actually, now i have the same problem (or a variation of it) :-)
I develop under Vista with eclipse. When i deploy the webapp from eclipse (to Tomcat6) validation works fine. But when i export to war-file and deploy it on my xubuntu laptop with Tomcat6, validation is omitted. The validation-files are present in the war-file. Could this be because of a different xml file encoding? (On vista it's UTF8. I have no idea what Tomcat6 expects but UTF8 sounds reasonable.)
-------- Original-Nachricht --------
> Datum: Thu, 14 Aug 2008 18:38:02 -0700 (PDT)
> Von: Dave Newton <ne...@yahoo.com>
> An: Struts Users Mailing List <us...@struts.apache.org>
> Betreff: RE: [S2]Validation with xml file not working
> I think he was asking the original poster if *his* stack included those
> interceptors in the correct order, since it's his validation that isn't
> working properly.
>
> Dave
>
> --- On Thu, 8/14/08, Martin Gainty <mg...@hotmail.com> wrote:
> > yes .. vanilla config from struts-default.xml
> >
> > <!-- Sample validation and workflow stack -->
> > <interceptor-stack
> > name="validationWorkflowStack">
> > <interceptor-ref
> > name="basicStack"/>
> > <interceptor-ref
> > name="validation"/>
> > <interceptor-ref
> > name="workflow"/>
> > </interceptor-stack>
> >
> > HTH
> > Martin
> >
> >
> > > Date: Fri, 15 Aug 2008 00:22:01 +0200
> > > From: simon.void@gmx.de
> > > Subject: Re: [S2]Validation with xml file not working
> > > To: user@struts.apache.org
> > >
> > > > What could it be?
> > >
> > > i don't know which interceptors are on your
> > default stack. Does 'workflow' come after
> > 'validation'?
> > >
> > > /Stephan
> > >
> > > -------- Original-Nachricht --------
> > > > Datum: Thu, 14 Aug 2008 18:20:33 +0200
> > > > Von: "Ylva Degerfeldt"
> > <yl...@gmail.com>
> > > > An: "Struts Users Mailing List"
> > <us...@struts.apache.org>
> > > > Betreff: Re: [S2]Validation with xml file not
> > working
> > >
> > > > Lukasz, I'm not sure how to check the
> > deployment but I was thinking
> > > > that too. (I'm using NetBeans 5.5.1 and Sun
> > App. server.)
> > > >
> > > > André, it's funny you should mention that
> > because I just changed the
> > > > name From .....-validation.xml to
> > ....-validations.xml because they
> > > > must have misspelled it in one place in the
> > "Struts 2 in Action" book,
> > > > so I thought that was the correct way since the
> > name without the s
> > > > gives me this exception:
> > > >
> > > > java.lang.IllegalArgumentException: URI is not
> > hierarchical
> > > >
> > > > At least I know it has nothing to do with that
> > I'm uploading a file
> > > > from a form, 'cause that part works fine.
> > It's something about the
> > > > validation. What could it be?
> > > >
> > > > /y
> > > >
> > > > On Thu, Aug 14, 2008 at 6:04 PM, André Cedik |
> > GDG
> > > > <a....@german-digital-group.de> wrote:
> > > > > Maybe it's just because of the
> > misspelling.
> > > > > If you'd like to do validation this way,
> > > > > your xml-file should be named
> > > > > "NameAndCvAction-validation.xml"
> > without
> > > > > the "s" at the end.
> > > > >
> > > > >
> > > > > Ylva Degerfeldt wrote:
> > > > >> Hi everyone,
> > > > >>
> > > > >> I'm trying to use the Validation
> > framework by creating a file called
> > > > >> NameAndCvAction-validations.xml, for my
> > action "NameAndCvAction", but
> > > > >> it's not working the way it should.
> > > > >> I've stepped through the code and it
> > seems that the validations that
> > > > >> should have been made through the xml
> > file just don't happen.
> > > > >>
> > > > >> When, for instance, I've tried to
> > deliberately leave some fields empty
> > > > >> (which the validator should have
> > noticed), the execute method is still
> > > > >> invoked. This shouldn't happen when
> > there are validation errors,
> > > > >> right?
> > > > >>
> > > > >> I've put the validation xml file in
> > the same directory (and package)
> > > > >> as the corresponding action, but it
> > seems that Struts 2 can't find it
> > > > >> anyway. What am I doing wrong?
> > > > >>
> > > > >> This is the declaration of my action in
> > struts.xml:
> > > > >> .....
> > > > >> <action name =
> > "NameAndCvAction" class =
> > > > "Web.StrutsActions.NameAndCvAction">
> > > > >>
> > <result>/showSkills.jsp</result>
> > > > >> <result name =
> > "input">/NameAndCv.jsp</result>
> > > > >> </action>
> > > > >> ....
> > > > >> (This belongs to a package that extends
> > struts-default)
> > > > >>
> > > > >> By the way, I'm also using simple
> > validation which works without
> > > > >> problems. (But I'd like to know how
> > to use the validation framework
> > > > >> "the harder way" too.)
> > > > >>
> > > > >> Can somebody please help me?
> > > > >>
> > > > >> Thanks in advance!
> > > > >>
> > > > >> /Ylva
--
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: [S2]Validation with xml file not working
Posted by Dave Newton <ne...@yahoo.com>.
I think he was asking the original poster if *his* stack included those interceptors in the correct order, since it's his validation that isn't working properly.
Dave
--- On Thu, 8/14/08, Martin Gainty <mg...@hotmail.com> wrote:
> yes .. vanilla config from struts-default.xml
>
> <!-- Sample validation and workflow stack -->
> <interceptor-stack
> name="validationWorkflowStack">
> <interceptor-ref
> name="basicStack"/>
> <interceptor-ref
> name="validation"/>
> <interceptor-ref
> name="workflow"/>
> </interceptor-stack>
>
> HTH
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to
> the official business of Sender. This transmission is of a
> confidential nature and Sender does not endorse distribution
> to any party other than intended recipient. Sender does not
> necessarily endorse content contained within this
> transmission.
>
>
> > Date: Fri, 15 Aug 2008 00:22:01 +0200
> > From: simon.void@gmx.de
> > Subject: Re: [S2]Validation with xml file not working
> > To: user@struts.apache.org
> >
> > > What could it be?
> >
> > i don't know which interceptors are on your
> default stack. Does 'workflow' come after
> 'validation'?
> >
> > /Stephan
> >
> > -------- Original-Nachricht --------
> > > Datum: Thu, 14 Aug 2008 18:20:33 +0200
> > > Von: "Ylva Degerfeldt"
> <yl...@gmail.com>
> > > An: "Struts Users Mailing List"
> <us...@struts.apache.org>
> > > Betreff: Re: [S2]Validation with xml file not
> working
> >
> > > Lukasz, I'm not sure how to check the
> deployment but I was thinking
> > > that too. (I'm using NetBeans 5.5.1 and Sun
> App. server.)
> > >
> > > André, it's funny you should mention that
> because I just changed the
> > > name From .....-validation.xml to
> ....-validations.xml because they
> > > must have misspelled it in one place in the
> "Struts 2 in Action" book,
> > > so I thought that was the correct way since the
> name without the s
> > > gives me this exception:
> > >
> > > java.lang.IllegalArgumentException: URI is not
> hierarchical
> > >
> > > At least I know it has nothing to do with that
> I'm uploading a file
> > > from a form, 'cause that part works fine.
> It's something about the
> > > validation. What could it be?
> > >
> > > /y
> > >
> > > On Thu, Aug 14, 2008 at 6:04 PM, André Cedik |
> GDG
> > > <a....@german-digital-group.de> wrote:
> > > > Maybe it's just because of the
> misspelling.
> > > > If you'd like to do validation this way,
> > > > your xml-file should be named
> > > > "NameAndCvAction-validation.xml"
> without
> > > > the "s" at the end.
> > > >
> > > >
> > > > Ylva Degerfeldt wrote:
> > > >> Hi everyone,
> > > >>
> > > >> I'm trying to use the Validation
> framework by creating a file called
> > > >> NameAndCvAction-validations.xml, for my
> action "NameAndCvAction", but
> > > >> it's not working the way it should.
> > > >> I've stepped through the code and it
> seems that the validations that
> > > >> should have been made through the xml
> file just don't happen.
> > > >>
> > > >> When, for instance, I've tried to
> deliberately leave some fields empty
> > > >> (which the validator should have
> noticed), the execute method is still
> > > >> invoked. This shouldn't happen when
> there are validation errors,
> > > >> right?
> > > >>
> > > >> I've put the validation xml file in
> the same directory (and package)
> > > >> as the corresponding action, but it
> seems that Struts 2 can't find it
> > > >> anyway. What am I doing wrong?
> > > >>
> > > >> This is the declaration of my action in
> struts.xml:
> > > >> .....
> > > >> <action name =
> "NameAndCvAction" class =
> > > "Web.StrutsActions.NameAndCvAction">
> > > >>
> <result>/showSkills.jsp</result>
> > > >> <result name =
> "input">/NameAndCv.jsp</result>
> > > >> </action>
> > > >> ....
> > > >> (This belongs to a package that extends
> struts-default)
> > > >>
> > > >> By the way, I'm also using simple
> validation which works without
> > > >> problems. (But I'd like to know how
> to use the validation framework
> > > >> "the harder way" too.)
> > > >>
> > > >> Can somebody please help me?
> > > >>
> > > >> Thanks in advance!
> > > >>
> > > >> /Ylva
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> 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
> > > >
> > > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> > --
> > GMX Kostenlose Spiele: Einfach online spielen und
> Spaß haben mit Pastry Passion!
> >
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Your PC, mobile phone, and online services work together
> like never before.
> http://clk.atdmt.com/MRT/go/108587394/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: [S2]Validation with xml file not working
Posted by Martin Gainty <mg...@hotmail.com>.
yes .. vanilla config from struts-default.xml
<!-- Sample validation and workflow stack -->
<interceptor-stack name="validationWorkflowStack">
<interceptor-ref name="basicStack"/>
<interceptor-ref name="validation"/>
<interceptor-ref name="workflow"/>
</interceptor-stack>
HTH
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Fri, 15 Aug 2008 00:22:01 +0200
> From: simon.void@gmx.de
> Subject: Re: [S2]Validation with xml file not working
> To: user@struts.apache.org
>
> > What could it be?
>
> i don't know which interceptors are on your default stack. Does 'workflow' come after 'validation'?
>
> /Stephan
>
> -------- Original-Nachricht --------
> > Datum: Thu, 14 Aug 2008 18:20:33 +0200
> > Von: "Ylva Degerfeldt" <yl...@gmail.com>
> > An: "Struts Users Mailing List" <us...@struts.apache.org>
> > Betreff: Re: [S2]Validation with xml file not working
>
> > Lukasz, I'm not sure how to check the deployment but I was thinking
> > that too. (I'm using NetBeans 5.5.1 and Sun App. server.)
> >
> > André, it's funny you should mention that because I just changed the
> > name From .....-validation.xml to ....-validations.xml because they
> > must have misspelled it in one place in the "Struts 2 in Action" book,
> > so I thought that was the correct way since the name without the s
> > gives me this exception:
> >
> > java.lang.IllegalArgumentException: URI is not hierarchical
> >
> > At least I know it has nothing to do with that I'm uploading a file
> > from a form, 'cause that part works fine. It's something about the
> > validation. What could it be?
> >
> > /y
> >
> > On Thu, Aug 14, 2008 at 6:04 PM, André Cedik | GDG
> > <a....@german-digital-group.de> wrote:
> > > Maybe it's just because of the misspelling.
> > > If you'd like to do validation this way,
> > > your xml-file should be named
> > > "NameAndCvAction-validation.xml" without
> > > the "s" at the end.
> > >
> > >
> > > Ylva Degerfeldt wrote:
> > >> Hi everyone,
> > >>
> > >> I'm trying to use the Validation framework by creating a file called
> > >> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
> > >> it's not working the way it should.
> > >> I've stepped through the code and it seems that the validations that
> > >> should have been made through the xml file just don't happen.
> > >>
> > >> When, for instance, I've tried to deliberately leave some fields empty
> > >> (which the validator should have noticed), the execute method is still
> > >> invoked. This shouldn't happen when there are validation errors,
> > >> right?
> > >>
> > >> I've put the validation xml file in the same directory (and package)
> > >> as the corresponding action, but it seems that Struts 2 can't find it
> > >> anyway. What am I doing wrong?
> > >>
> > >> This is the declaration of my action in struts.xml:
> > >> .....
> > >> <action name = "NameAndCvAction" class =
> > "Web.StrutsActions.NameAndCvAction">
> > >> <result>/showSkills.jsp</result>
> > >> <result name = "input">/NameAndCv.jsp</result>
> > >> </action>
> > >> ....
> > >> (This belongs to a package that extends struts-default)
> > >>
> > >> By the way, I'm also using simple validation which works without
> > >> problems. (But I'd like to know how to use the validation framework
> > >> "the harder way" too.)
> > >>
> > >> Can somebody please help me?
> > >>
> > >> Thanks in advance!
> > >>
> > >> /Ylva
> > >>
> > >> ---------------------------------------------------------------------
> > >> 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
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
>
> --
> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Your PC, mobile phone, and online services work together like never before.
http://clk.atdmt.com/MRT/go/108587394/direct/01/
Re: [S2]Validation with xml file not working
Posted by Stephan Schröder <si...@gmx.de>.
> What could it be?
i don't know which interceptors are on your default stack. Does 'workflow' come after 'validation'?
/Stephan
-------- Original-Nachricht --------
> Datum: Thu, 14 Aug 2008 18:20:33 +0200
> Von: "Ylva Degerfeldt" <yl...@gmail.com>
> An: "Struts Users Mailing List" <us...@struts.apache.org>
> Betreff: Re: [S2]Validation with xml file not working
> Lukasz, I'm not sure how to check the deployment but I was thinking
> that too. (I'm using NetBeans 5.5.1 and Sun App. server.)
>
> André, it's funny you should mention that because I just changed the
> name From .....-validation.xml to ....-validations.xml because they
> must have misspelled it in one place in the "Struts 2 in Action" book,
> so I thought that was the correct way since the name without the s
> gives me this exception:
>
> java.lang.IllegalArgumentException: URI is not hierarchical
>
> At least I know it has nothing to do with that I'm uploading a file
> from a form, 'cause that part works fine. It's something about the
> validation. What could it be?
>
> /y
>
> On Thu, Aug 14, 2008 at 6:04 PM, André Cedik | GDG
> <a....@german-digital-group.de> wrote:
> > Maybe it's just because of the misspelling.
> > If you'd like to do validation this way,
> > your xml-file should be named
> > "NameAndCvAction-validation.xml" without
> > the "s" at the end.
> >
> >
> > Ylva Degerfeldt wrote:
> >> Hi everyone,
> >>
> >> I'm trying to use the Validation framework by creating a file called
> >> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
> >> it's not working the way it should.
> >> I've stepped through the code and it seems that the validations that
> >> should have been made through the xml file just don't happen.
> >>
> >> When, for instance, I've tried to deliberately leave some fields empty
> >> (which the validator should have noticed), the execute method is still
> >> invoked. This shouldn't happen when there are validation errors,
> >> right?
> >>
> >> I've put the validation xml file in the same directory (and package)
> >> as the corresponding action, but it seems that Struts 2 can't find it
> >> anyway. What am I doing wrong?
> >>
> >> This is the declaration of my action in struts.xml:
> >> .....
> >> <action name = "NameAndCvAction" class =
> "Web.StrutsActions.NameAndCvAction">
> >> <result>/showSkills.jsp</result>
> >> <result name = "input">/NameAndCv.jsp</result>
> >> </action>
> >> ....
> >> (This belongs to a package that extends struts-default)
> >>
> >> By the way, I'm also using simple validation which works without
> >> problems. (But I'd like to know how to use the validation framework
> >> "the harder way" too.)
> >>
> >> Can somebody please help me?
> >>
> >> Thanks in advance!
> >>
> >> /Ylva
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
--
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2]Validation with xml file not working
Posted by Ylva Degerfeldt <yl...@gmail.com>.
Lukasz, I'm not sure how to check the deployment but I was thinking
that too. (I'm using NetBeans 5.5.1 and Sun App. server.)
André, it's funny you should mention that because I just changed the
name From .....-validation.xml to ....-validations.xml because they
must have misspelled it in one place in the "Struts 2 in Action" book,
so I thought that was the correct way since the name without the s
gives me this exception:
java.lang.IllegalArgumentException: URI is not hierarchical
At least I know it has nothing to do with that I'm uploading a file
from a form, 'cause that part works fine. It's something about the
validation. What could it be?
/y
On Thu, Aug 14, 2008 at 6:04 PM, André Cedik | GDG
<a....@german-digital-group.de> wrote:
> Maybe it's just because of the misspelling.
> If you'd like to do validation this way,
> your xml-file should be named
> "NameAndCvAction-validation.xml" without
> the "s" at the end.
>
>
> Ylva Degerfeldt wrote:
>> Hi everyone,
>>
>> I'm trying to use the Validation framework by creating a file called
>> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
>> it's not working the way it should.
>> I've stepped through the code and it seems that the validations that
>> should have been made through the xml file just don't happen.
>>
>> When, for instance, I've tried to deliberately leave some fields empty
>> (which the validator should have noticed), the execute method is still
>> invoked. This shouldn't happen when there are validation errors,
>> right?
>>
>> I've put the validation xml file in the same directory (and package)
>> as the corresponding action, but it seems that Struts 2 can't find it
>> anyway. What am I doing wrong?
>>
>> This is the declaration of my action in struts.xml:
>> .....
>> <action name = "NameAndCvAction" class = "Web.StrutsActions.NameAndCvAction">
>> <result>/showSkills.jsp</result>
>> <result name = "input">/NameAndCv.jsp</result>
>> </action>
>> ....
>> (This belongs to a package that extends struts-default)
>>
>> By the way, I'm also using simple validation which works without
>> problems. (But I'd like to know how to use the validation framework
>> "the harder way" too.)
>>
>> Can somebody please help me?
>>
>> Thanks in advance!
>>
>> /Ylva
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2]Validation with xml file not working
Posted by André Cedik | GDG <a....@german-digital-group.de>.
Maybe it's just because of the misspelling.
If you'd like to do validation this way,
your xml-file should be named
"NameAndCvAction-validation.xml" without
the "s" at the end.
Ylva Degerfeldt wrote:
> Hi everyone,
>
> I'm trying to use the Validation framework by creating a file called
> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
> it's not working the way it should.
> I've stepped through the code and it seems that the validations that
> should have been made through the xml file just don't happen.
>
> When, for instance, I've tried to deliberately leave some fields empty
> (which the validator should have noticed), the execute method is still
> invoked. This shouldn't happen when there are validation errors,
> right?
>
> I've put the validation xml file in the same directory (and package)
> as the corresponding action, but it seems that Struts 2 can't find it
> anyway. What am I doing wrong?
>
> This is the declaration of my action in struts.xml:
> .....
> <action name = "NameAndCvAction" class = "Web.StrutsActions.NameAndCvAction">
> <result>/showSkills.jsp</result>
> <result name = "input">/NameAndCv.jsp</result>
> </action>
> ....
> (This belongs to a package that extends struts-default)
>
> By the way, I'm also using simple validation which works without
> problems. (But I'd like to know how to use the validation framework
> "the harder way" too.)
>
> Can somebody please help me?
>
> Thanks in advance!
>
> /Ylva
>
> ---------------------------------------------------------------------
> 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