You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sa...@roularta.be on 2009/08/17 12:01:56 UTC
validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form>
...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator>
</field>
</validators>
thx!
Sandy
RE: validation
Posted by Sa...@roularta.be.
I extended ActionSupport
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: woensdag 19 augustus 2009 12:17
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Hi,
In your action did you extends ActionSupport or implement Validateable ?
Louis
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Wednesday, August 19, 2009 7:16:08 AM
Subject: RE: validation
Yes, that was a copy-mistake of me.
In my app it is 'be.shop.service.ProductActions
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: dinsdag 18 augustus 2009 17:47
Aan: Struts Users Mailing List
Onderwerp: Re: validation
In your package, you define 2 action
<action name="addProduct" class="be.shop.service.TestActions"
method="addProduct"> and <action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
If you want the validation for addProduct, then you should have
TestActions-addProduct-validation.xml
instead of
ProductActions-addProduct.validation.xml
Louis
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Tuesday, August 18, 2009 7:32:06 AM
Subject: RE: validation
Hi,
This is my projectstructure and the files you asked.
Hope you see something wrong..
Thx,
Sandy
Dir structure (as i see it in explorer):
Shop
-.settings
-src
-main
-java
-be
-shop
-data
-dataAccess
-service
-ProductActions.java
-ProductActions-addProduct.validation.xml
-webapp
-includes
menu.jsp
-WEB-INF
-classes
-struts.properties
-struts.xml
-struts-tags.tld
-web.xml
-products.jsp
-adress.jsp
-test
-java ....
-target
-pom.xml
-.project
-.classpath
web.xml:
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 - Maven Archetype - Starter</display-name>
<filter>
<filter-name>action2-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter
-class>
</filter>
<filter>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-cla
ss>
</filter>
<filter-mapping>
<filter-name>action2-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<package name="shop" namespace="/service" extends="struts-default">
<action name="addProduct"
class="be.shop.service.TestActions" method="addProduct">
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
<action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
</package>
</struts>
ProductActions-addProduct-validation.xml:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="minInclusive">0.0</param>
<param name="maxInclusive">3.0</param>
<message>Weight has to be numeric and can't be less than
0.</message>
</field-validator>
</field>
</validators>
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 18:38
Aan: Struts Users Mailing List
Onderwerp: Re: validation
what I can guess here is your setup problem rather then the double field
validator problem.
Can you post ur full struts.xml, validation.xml and your directory
structure where u put your files.
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2:09:45 PM
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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: validation
Posted by ma...@yahoo.com.
Hi,
In your action did you extends ActionSupport or implement Validateable ?
Louis
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Wednesday, August 19, 2009 7:16:08 AM
Subject: RE: validation
Yes, that was a copy-mistake of me.
In my app it is 'be.shop.service.ProductActions
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: dinsdag 18 augustus 2009 17:47
Aan: Struts Users Mailing List
Onderwerp: Re: validation
In your package, you define 2 action
<action name="addProduct" class="be.shop.service.TestActions"
method="addProduct"> and <action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
If you want the validation for addProduct, then you should have
TestActions-addProduct-validation.xml
instead of
ProductActions-addProduct.validation.xml
Louis
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Tuesday, August 18, 2009 7:32:06 AM
Subject: RE: validation
Hi,
This is my projectstructure and the files you asked.
Hope you see something wrong..
Thx,
Sandy
Dir structure (as i see it in explorer):
Shop
-.settings
-src
-main
-java
-be
-shop
-data
-dataAccess
-service
-ProductActions.java
-ProductActions-addProduct.validation.xml
-webapp
-includes
menu.jsp
-WEB-INF
-classes
-struts.properties
-struts.xml
-struts-tags.tld
-web.xml
-products.jsp
-adress.jsp
-test
-java ....
-target
-pom.xml
-.project
-.classpath
web.xml:
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 - Maven Archetype - Starter</display-name>
<filter>
<filter-name>action2-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter
-class>
</filter>
<filter>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-cla
ss>
</filter>
<filter-mapping>
<filter-name>action2-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<package name="shop" namespace="/service" extends="struts-default">
<action name="addProduct"
class="be.shop.service.TestActions" method="addProduct">
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
<action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
</package>
</struts>
ProductActions-addProduct-validation.xml:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="minInclusive">0.0</param>
<param name="maxInclusive">3.0</param>
<message>Weight has to be numeric and can't be less than
0.</message>
</field-validator>
</field>
</validators>
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 18:38
Aan: Struts Users Mailing List
Onderwerp: Re: validation
what I can guess here is your setup problem rather then the double field
validator problem.
Can you post ur full struts.xml, validation.xml and your directory
structure where u put your files.
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2:09:45 PM
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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: validation
Posted by Sa...@roularta.be.
Yes, that was a copy-mistake of me.
In my app it is 'be.shop.service.ProductActions
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: dinsdag 18 augustus 2009 17:47
Aan: Struts Users Mailing List
Onderwerp: Re: validation
In your package, you define 2 action
<action name="addProduct" class="be.shop.service.TestActions"
method="addProduct"> and <action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
If you want the validation for addProduct, then you should have
TestActions-addProduct-validation.xml
instead of
ProductActions-addProduct.validation.xml
Louis
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Tuesday, August 18, 2009 7:32:06 AM
Subject: RE: validation
Hi,
This is my projectstructure and the files you asked.
Hope you see something wrong..
Thx,
Sandy
Dir structure (as i see it in explorer):
Shop
-.settings
-src
-main
-java
-be
-shop
-data
-dataAccess
-service
-ProductActions.java
-ProductActions-addProduct.validation.xml
-webapp
-includes
menu.jsp
-WEB-INF
-classes
-struts.properties
-struts.xml
-struts-tags.tld
-web.xml
-products.jsp
-adress.jsp
-test
-java ....
-target
-pom.xml
-.project
-.classpath
web.xml:
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 - Maven Archetype - Starter</display-name>
<filter>
<filter-name>action2-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter
-class>
</filter>
<filter>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-cla
ss>
</filter>
<filter-mapping>
<filter-name>action2-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<package name="shop" namespace="/service" extends="struts-default">
<action name="addProduct"
class="be.shop.service.TestActions" method="addProduct">
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
<action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
</package>
</struts>
ProductActions-addProduct-validation.xml:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="minInclusive">0.0</param>
<param name="maxInclusive">3.0</param>
<message>Weight has to be numeric and can't be less than
0.</message>
</field-validator>
</field>
</validators>
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 18:38
Aan: Struts Users Mailing List
Onderwerp: Re: validation
what I can guess here is your setup problem rather then the double field
validator problem.
Can you post ur full struts.xml, validation.xml and your directory
structure where u put your files.
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2:09:45 PM
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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: validation
Posted by ma...@yahoo.com.
In your package, you define 2 action
<action name="addProduct" class="be.shop.service.TestActions" method="addProduct">
and
<action name="goToProducts" class="be.shop.service.ProductActions" method="goToProducts">
If you want the validation for addProduct, then you should have
TestActions-addProduct-validation.xml
instead of
ProductActions-addProduct.validation.xml
Louis
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Tuesday, August 18, 2009 7:32:06 AM
Subject: RE: validation
Hi,
This is my projectstructure and the files you asked.
Hope you see something wrong..
Thx,
Sandy
Dir structure (as i see it in explorer):
Shop
-.settings
-src
-main
-java
-be
-shop
-data
-dataAccess
-service
-ProductActions.java
-ProductActions-addProduct.validation.xml
-webapp
-includes
menu.jsp
-WEB-INF
-classes
-struts.properties
-struts.xml
-struts-tags.tld
-web.xml
-products.jsp
-adress.jsp
-test
-java ....
-target
-pom.xml
-.project
-.classpath
web.xml:
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 - Maven Archetype -
Starter</display-name>
<filter>
<filter-name>action2-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter
-class>
</filter>
<filter>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-cla
ss>
</filter>
<filter-mapping>
<filter-name>action2-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<package name="shop" namespace="/service" extends="struts-default">
<action name="addProduct"
class="be.shop.service.TestActions" method="addProduct">
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
<action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
</package>
</struts>
ProductActions-addProduct-validation.xml:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="minInclusive">0.0</param>
<param name="maxInclusive">3.0</param>
<message>Weight has to be numeric and can't be less than
0.</message>
</field-validator>
</field>
</validators>
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 18:38
Aan: Struts Users Mailing List
Onderwerp: Re: validation
what I can guess here is your setup problem rather then the double
field validator problem.
Can you post ur full struts.xml, validation.xml and your directory
structure where u put your files.
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2:09:45 PM
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Sa...@roularta.be.
Hi,
This is my projectstructure and the files you asked.
Hope you see something wrong..
Thx,
Sandy
Dir structure (as i see it in explorer):
Shop
-.settings
-src
-main
-java
-be
-shop
-data
-dataAccess
-service
-ProductActions.java
-ProductActions-addProduct.validation.xml
-webapp
-includes
menu.jsp
-WEB-INF
-classes
-struts.properties
-struts.xml
-struts-tags.tld
-web.xml
-products.jsp
-adress.jsp
-test
-java ....
-target
-pom.xml
-.project
-.classpath
web.xml:
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 - Maven Archetype -
Starter</display-name>
<filter>
<filter-name>action2-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter
-class>
</filter>
<filter>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-cla
ss>
</filter>
<filter-mapping>
<filter-name>action2-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<package name="shop" namespace="/service" extends="struts-default">
<action name="addProduct"
class="be.shop.service.TestActions" method="addProduct">
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
<action name="goToProducts"
class="be.shop.service.ProductActions" method="goToProducts">
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
</package>
</struts>
ProductActions-addProduct-validation.xml:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="minInclusive">0.0</param>
<param name="maxInclusive">3.0</param>
<message>Weight has to be numeric and can't be less than
0.</message>
</field-validator>
</field>
</validators>
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 18:38
Aan: Struts Users Mailing List
Onderwerp: Re: validation
what I can guess here is your setup problem rather then the double
field validator problem.
Can you post ur full struts.xml, validation.xml and your directory
structure where u put your files.
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2:09:45 PM
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: validation
Posted by ma...@yahoo.com.
what I can guess here is your setup problem rather then the double field validator problem.
Can you post ur full struts.xml, validation.xml and your directory structure where u put your files.
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2:09:45 PM
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by Sa...@roularta.be.
Martin,
I changed my param values to double formatted values.
But it doesn't help.
Thx anyway.
Sandy
-----Oorspronkelijk bericht-----
Van: Martin Gainty [mailto:mgainty@hotmail.com]
Verzonden: maandag 17 augustus 2009 16:26
Aan: Struts Users Mailing List
Onderwerp: RE: validation
check if you are validating double formatted numerics (instead of ints)
<field name="percentage">
<field-validator type="double">
<param name="minExclusive">0.1</param>
<param name="maxExclusive">10.1</param>
<message>percentage must be between ${minExclusive} and ${maxExclusive}</message>
</field-validator>
</field>
(notice the 99.9 format)
Martin Gainty
______________________________________________
Note de déni et de confidentialité
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Subject: RE: validation
> Date: Mon, 17 Aug 2009 15:51:30 +0200
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
>
> Thx for the effort chris!
> Can you tell me what the outcome should be?
> I expect 'Weight has to be numeric and can't be less than 0. ' right
> next to the weight textfield?
>
> Right now i just get internal server error, but i'm working on it..
>
> -----Oorspronkelijk bericht-----
> Van: musomesa@aol.com [mailto:musomesa@aol.com]
> Verzonden: maandag 17 augustus 2009 15:28
> Aan: user@struts.apache.org
> Onderwerp: Re: validation
>
>
> ok -- I used as much of your code as you have posted and put a
> working version at
>
> http://pastie.org/585837
>
> Chris
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 2:09 pm
> Subject: RE: validation
>
>
>
>
>
>
>
>
>
>
> Requiredstring doesn't work neither..
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 14:16
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> how about change your field validator to requiredstring just to check
> which part of your setting went wrong?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:54:04 PM
> Subject: RE: validation
>
> Yes, this is my package declaration in struts.xml:
> <package name="shop" extends="struts-default">
>
> I changed the namespace of my formtag (on the jsp page) into 'shop',
> according to the package name.
> But it doesn't help..
>
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:42
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> do you extends="struts-default" in your package?
>
> or may be just put this
> <default-interceptor-ref name="defaultStack" /> in your package to
> check
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:26:45 PM
> Subject: RE: validation
>
> Thx for the reply,
> I have no interceptors declared in my struts.xml, so I assume i use
> defaultstack interceptor, or not?
> Jes, the validation xml is in the same dir as my class.
>
> Any other thoughts?
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:12
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> Are u using defaultStack interceptor? If not u need to make sure
> validate and workflow interceptor are in your interceptor stack.
>
> Another check is are u putting the
> ProductActions-addProduct-validation.xml in the same directory as your
> ProductActions.java ?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 11:01:56 AM
> Subject: validation
>
> Hi,
>
> I'm trying to add some validation to my fstruts 2 form but it won't
> work.
> If I enter for example value '6' in my weight textfield and press
> 'add', the debugger comes in the method 'addProduct', finishes and
> returns to products.jsp.
> There is no message shown as defined in the validation xml.
> Does someone see what goes wrong?
>
>
> In products.jsp I have the following code:
> ...
> <s:head/>
> </head>
> ...
> <s:fielderror />
> <s:actionerror />
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
> weight: <s:textfield name="weight" />
> <s:submit value="addProduct" align="center" cssClass="button" />
> </s:form> ...
>
> In struts.xml I have:
>
> <action name="addProduct" class="be.shop.service.ProductActions"
> method="addProduct" >
> <result name="input">/products.jsp</result>
> <result>/products.jsp</result>
> <result name="error">/products.jsp</result>
> </action>
>
> In ProductActions.java i have:
>
> public String addProduct(){
> return SUCCESS;
> }
>
> In ProductActions-addProduct-validation.xml I have:
>
> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
> 1.0.2//EN"
> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
> <validators>
> <field name="weight">
> <field-validator type="double">
> <param name="min">0</param>
> <param name="max">3</param>
> <message>Weight has to be numeric and can't be less than 0.</message>
> </field-validator> </field> </validators>
>
> thx!
>
> Sandy
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Martin Gainty <mg...@hotmail.com>.
check if you are validating double formatted numerics (instead of ints)
<field name="percentage">
<field-validator type="double">
<param name="minExclusive">0.1</param>
<param name="maxExclusive">10.1</param>
<message>percentage must be between ${minExclusive} and ${maxExclusive}</message>
</field-validator>
</field>
(notice the 99.9 format)
Martin Gainty
______________________________________________
Note de déni et de confidentialité
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Subject: RE: validation
> Date: Mon, 17 Aug 2009 15:51:30 +0200
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
>
> Thx for the effort chris!
> Can you tell me what the outcome should be?
> I expect 'Weight has to be numeric and can't be less than 0. ' right
> next to the weight textfield?
>
> Right now i just get internal server error, but i'm working on it..
>
> -----Oorspronkelijk bericht-----
> Van: musomesa@aol.com [mailto:musomesa@aol.com]
> Verzonden: maandag 17 augustus 2009 15:28
> Aan: user@struts.apache.org
> Onderwerp: Re: validation
>
>
> ok -- I used as much of your code as you have posted and put a working
> version at
>
> http://pastie.org/585837
>
> Chris
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 2:09 pm
> Subject: RE: validation
>
>
>
>
>
>
>
>
>
>
> Requiredstring doesn't work neither..
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 14:16
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> how about change your field validator to requiredstring just to check
> which part of your setting went wrong?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:54:04 PM
> Subject: RE: validation
>
> Yes, this is my package declaration in struts.xml:
> <package name="shop" extends="struts-default">
>
> I changed the namespace of my formtag (on the jsp page) into 'shop',
> according to the package name.
> But it doesn't help..
>
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:42
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> do you extends="struts-default" in your package?
>
> or may be just put this
> <default-interceptor-ref name="defaultStack" /> in your package to check
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:26:45 PM
> Subject: RE: validation
>
> Thx for the reply,
> I have no interceptors declared in my struts.xml, so I assume i use
> defaultstack interceptor, or not?
> Jes, the validation xml is in the same dir as my class.
>
> Any other thoughts?
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:12
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> Are u using defaultStack interceptor? If not u need to make sure
> validate and workflow interceptor are in your interceptor stack.
>
> Another check is are u putting the
> ProductActions-addProduct-validation.xml in the same directory as your
> ProductActions.java ?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 11:01:56 AM
> Subject: validation
>
> Hi,
>
> I'm trying to add some validation to my fstruts 2 form but it won't
> work.
> If I enter for example value '6' in my weight textfield and press 'add',
> the debugger comes in the method 'addProduct', finishes and returns to
> products.jsp.
> There is no message shown as defined in the validation xml.
> Does someone see what goes wrong?
>
>
> In products.jsp I have the following code:
> ...
> <s:head/>
> </head>
> ...
> <s:fielderror />
> <s:actionerror />
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
> weight: <s:textfield name="weight" />
> <s:submit value="addProduct" align="center" cssClass="button" />
> </s:form> ...
>
> In struts.xml I have:
>
> <action name="addProduct" class="be.shop.service.ProductActions"
> method="addProduct" >
> <result name="input">/products.jsp</result>
> <result>/products.jsp</result>
> <result name="error">/products.jsp</result>
> </action>
>
> In ProductActions.java i have:
>
> public String addProduct(){
> return SUCCESS;
> }
>
> In ProductActions-addProduct-validation.xml I have:
>
> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
> 1.0.2//EN"
> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
> <validators>
> <field name="weight">
> <field-validator type="double">
> <param name="min">0</param>
> <param name="max">3</param>
> <message>Weight has to be numeric and can't be less than 0.</message>
> </field-validator> </field> </validators>
>
> thx!
>
> Sandy
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009
Re: validation
Posted by Eduard Neuwirt <ed...@googlemail.com>.
Hi all,
if you declare a field as int and pass a non int value, the described
error occurs. Either use string or be sure to put the correct value.
Regards
Eduard
musomesa@aol.com schrieb:
> That looks like a question -- it is meant to be an assertion but somehow question marks crept in.
> C.
>
>
>
>
>
>
>
> -----Original Message-----
> From: musomesa@aol.com
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 11:12 am
> Subject: Re: validation
>
>
>
>
>
>
>
>
>
>
>
> For primitives and dates you don't need to do anything? -- the type conversion
> is automatic
> Chris
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 10:43 am
> Subject: RE: validation
>
>
>
>
>
>
>
>
>
>
> Chris,
>
> Your version doesn't work for me neither..
> Maybe you can tell me the paths of each file you putted at pastie?
>
> Anyway, I can not pass a double value from my jsp file to my
> actionclass. Then I get the error 'no such method found for
> 'setPrice(java.lang.String)''.
> So I make a setter with a string and convert it. Assuming the value
> would be already parsed in the validation xml,so my conversion will
> work.
> Is this normal?
>
> Regards,
> Sandy
>
> -----Oorspronkelijk bericht-----
> Van: musomesa@aol.com [mailto:musomesa@aol.com]
> Verzonden: maandag 17 augustus 2009 15:28
> Aan: user@struts.apache.org
> Onderwerp: Re: validation
>
>
> ok -- I used as much of your code as you have posted and put a working
> version at
>
> http://pastie.org/585837
>
> Chris
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 2:09 pm
> Subject: RE: validation
>
>
>
>
>
>
>
>
>
>
> Requiredstring doesn't work neither..
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 14:16
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> how about change your field validator to requiredstring just to check
> which part of your setting went wrong?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:54:04 PM
> Subject: RE: validation
>
> Yes, this is my package declaration in struts.xml:
> <package name="shop" extends="struts-default">
>
> I changed the namespace of my formtag (on the jsp page) into 'shop',
> according to the package name.
> But it doesn't help..
>
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:42
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> do you extends="struts-default" in your package?
>
> or may be just put this
> <default-interceptor-ref name="defaultStack" /> in your package to check
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:26:45 PM
> Subject: RE: validation
>
> Thx for the reply,
> I have no interceptors declared in my struts.xml, so I assume i use
> defaultstack interceptor, or not?
> Jes, the validation xml is in the same dir as my class.
>
> Any other thoughts?
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:12
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> Are u using defaultStack interceptor? If not u need to make sure
> validate and workflow interceptor are in your interceptor stack.
>
> Another check is are u putting the
> ProductActions-addProduct-validation.xml in the same directory as your
> ProductActions.java ?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 11:01:56 AM
> Subject: validation
>
> Hi,
>
> I'm trying to add some validation to my fstruts 2 form but it won't
> work.
> If I enter for example value '6' in my weight textfield and press 'add',
> the debugger comes in the method 'addProduct', finishes and returns to
> products.jsp.
> There is no message shown as defined in the validation xml.
> Does someone see what goes wrong?
>
>
> In products.jsp I have the following code:
> ...
> <s:head/>
> </head>
> ...
> <s:fielderror />
> <s:actionerror />
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
> weight: <s:textfield name="weight" />
> <s:submit value="addProduct" align="center" cssClass="button" />
> </s:form> ...
>
> In struts.xml I have:
>
> <action name="addProduct" class="be.shop.service.ProductActions"
> method="addProduct" >
> <result name="input">/products.jsp</result>
> <result>/products.jsp</result>
> <result name="error">/products.jsp</result>
> </action>
>
> In ProductActions.java i have:
>
> public String addProduct(){
> return SUCCESS;
> }
>
> In ProductActions-addProduct-validation.xml I have:
>
> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
> 1.0.2//EN"
> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
> <validators>
> <field name="weight">
> <field-validator type="double">
> <param name="min">0</param>
> <param name="max">3</param>
> <message>Weight has to be numeric and can't be less than 0.</message>
> </field-validator> </field> </validators>
>
> thx!
>
> Sandy
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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: validation
Posted by mu...@aol.com.
That looks like a question -- it is meant to be an assertion but somehow question marks crept in.
C.
-----Original Message-----
From: musomesa@aol.com
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 11:12 am
Subject: Re: validation
For primitives and dates you don't need to do anything? -- the type conversion
is automatic
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 10:43 am
Subject: RE: validation
Chris,
Your version doesn't work for me neither..
Maybe you can tell me the paths of each file you putted at pastie?
Anyway, I can not pass a double value from my jsp file to my
actionclass. Then I get the error 'no such method found for
'setPrice(java.lang.String)''.
So I make a setter with a string and convert it. Assuming the value
would be already parsed in the validation xml,so my conversion will
work.
Is this normal?
Regards,
Sandy
-----Oorspronkelijk bericht-----
Van: musomesa@aol.com [mailto:musomesa@aol.com]
Verzonden: maandag 17 augustus 2009 15:28
Aan: user@struts.apache.org
Onderwerp: Re: validation
ok -- I used as much of your code as you have posted and put a working
version at
http://pastie.org/585837
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 2:09 pm
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: validation
Posted by mu...@aol.com.
For primitives and dates you don't need to do anything? -- the type conversion is automatic
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 10:43 am
Subject: RE: validation
Chris,
Your version doesn't work for me neither..
Maybe you can tell me the paths of each file you putted at pastie?
Anyway, I can not pass a double value from my jsp file to my
actionclass. Then I get the error 'no such method found for
'setPrice(java.lang.String)''.
So I make a setter with a string and convert it. Assuming the value
would be already parsed in the validation xml,so my conversion will
work.
Is this normal?
Regards,
Sandy
-----Oorspronkelijk bericht-----
Van: musomesa@aol.com [mailto:musomesa@aol.com]
Verzonden: maandag 17 augustus 2009 15:28
Aan: user@struts.apache.org
Onderwerp: Re: validation
ok -- I used as much of your code as you have posted and put a working
version at
http://pastie.org/585837
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 2:09 pm
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Sa...@roularta.be.
Chris,
Your version doesn't work for me neither..
Maybe you can tell me the paths of each file you putted at pastie?
Anyway, I can not pass a double value from my jsp file to my
actionclass. Then I get the error 'no such method found for
'setPrice(java.lang.String)''.
So I make a setter with a string and convert it. Assuming the value
would be already parsed in the validation xml,so my conversion will
work.
Is this normal?
Regards,
Sandy
-----Oorspronkelijk bericht-----
Van: musomesa@aol.com [mailto:musomesa@aol.com]
Verzonden: maandag 17 augustus 2009 15:28
Aan: user@struts.apache.org
Onderwerp: Re: validation
ok -- I used as much of your code as you have posted and put a working
version at
http://pastie.org/585837
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 2:09 pm
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Sa...@roularta.be.
Thx for the effort chris!
Can you tell me what the outcome should be?
I expect 'Weight has to be numeric and can't be less than 0. ' right
next to the weight textfield?
Right now i just get internal server error, but i'm working on it..
-----Oorspronkelijk bericht-----
Van: musomesa@aol.com [mailto:musomesa@aol.com]
Verzonden: maandag 17 augustus 2009 15:28
Aan: user@struts.apache.org
Onderwerp: Re: validation
ok -- I used as much of your code as you have posted and put a working
version at
http://pastie.org/585837
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 2:09 pm
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: validation
Posted by mu...@aol.com.
ok -- I used as much of your code as you have posted and put a working version at
http://pastie.org/585837
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 2:09 pm
Subject: RE: validation
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by Sa...@roularta.be.
Requiredstring doesn't work neither..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation
how about change your field validator to requiredstring just to check
which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by ma...@yahoo.com.
how about change your field validator to requiredstring just to check which part of your setting went wrong?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by Paweł Wielgus <po...@gmail.com>.
Hi again,
sorry for that,
i haven't read previous post good enougth,
it's defined in struts.xml
But one another thing You can do is to check how things are mapped in
Config Browser plugin.
Best greetings,
Paweł Wielgus.
2009/8/17 <Sa...@roularta.be>:
> Pawe,
>
> Yes addProduct is called in the ProductActions in be.shop.service
>
> It is unclear to me what I should use for 'name' and for 'namespace' in the package-tag.
>
>
>
> It should be called right away, the validationintercepter should be progressed first.;
>
> Sandy
>
> -----Oorspronkelijk bericht-----
> Van: Paweł Wielgus [mailto:poulwiel@gmail.com]
> Verzonden: maandag 17 augustus 2009 14:35
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> Hi Sandy,
> is your addProduct method in ProductActions action being called?
> it is unclear for me how would it happen, because You are referencing addProduct action in /service namespace which would normally be some_base_actions_package.service.AddProductAction.java
> Is it done with REST?
>
> Best greetings,
> Paweł Wielgus.
>
> 2009/8/17 <Sa...@roularta.be>:
>>
>> I have my package
>> -be.shop.service
>> Which contains ProductActions.java and
>> ProductActions-addProduct-validation.xml
>>
>> In my struts.xml i have the package tag:
>> <package name="shop" extends="struts-default" namespace="/service">
>>
>> In my jsp page i have the form tag:
>> <s:form action="addProduct" method="post" validate="true"
>> namespace="/service">
>>
>> I assume that my packagedeclaration in struts.xml isn't right?
>>
>> I'm not sure what the difference is between name, namespace and package?
>>
>>
>>
>>
>>
>> -----Oorspronkelijk bericht-----
>> Van: musomesa@aol.com [mailto:musomesa@aol.com]
>> Verzonden: maandag 17 augustus 2009 14:07
>> Aan: user@struts.apache.org
>> Onderwerp: Re: validation
>>
>>
>> In the products.jsp you assume the action? addProduct to be in the
>> "/service" namespace but? "shop" package which contains the action is
>> not in the "/service" namespace.
>>
>> Try
>>
>>
>>
>>
>> <package name="shop" namespace="/service" extends="struts-default" >
>>
>>
>>
>>
>> -----Original Message-----
>> From: Sandy.Verfaille@roularta.be
>> To: user@struts.apache.org
>> Sent: Mon, Aug 17, 2009 7:54 am
>> Subject: RE: validation
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Yes, this is my package declaration in struts.xml:
>> <package name="shop" extends="struts-default">
>>
>> I changed the namespace of my formtag (on the jsp page) into 'shop',
>> according to the package name.
>> But it doesn't help..
>>
>>
>> -----Oorspronkelijk bericht-----
>> Van: mailtolouis2020-struts@yahoo.com
>> [mailto:mailtolouis2020-struts@yahoo.com]
>> Verzonden: maandag 17 augustus 2009 13:42
>> Aan: Struts Users Mailing List
>> Onderwerp: Re: validation
>>
>> do you extends="struts-default" in your package?
>>
>> or may be just put this
>> <default-interceptor-ref name="defaultStack" /> in your package to
>> check
>>
>>
>>
>> ________________________________
>> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
>> To: user@struts.apache.org
>> Sent: Monday, August 17, 2009 12:26:45 PM
>> Subject: RE: validation
>>
>> Thx for the reply,
>> I have no interceptors declared in my struts.xml, so I assume i use
>> defaultstack interceptor, or not?
>> Jes, the validation xml is in the same dir as my class.
>>
>> Any other thoughts?
>>
>> -----Oorspronkelijk bericht-----
>> Van: mailtolouis2020-struts@yahoo.com
>> [mailto:mailtolouis2020-struts@yahoo.com]
>> Verzonden: maandag 17 augustus 2009 13:12
>> Aan: Struts Users Mailing List
>> Onderwerp: Re: validation
>>
>> Are u using defaultStack interceptor? If not u need to make sure
>> validate and workflow interceptor are in your interceptor stack.
>>
>> Another check is are u putting the
>> ProductActions-addProduct-validation.xml in the same directory as your
>> ProductActions.java ?
>>
>>
>>
>> ________________________________
>> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
>> To: user@struts.apache.org
>> Sent: Monday, August 17, 2009 11:01:56 AM
>> Subject: validation
>>
>> Hi,
>>
>> I'm trying to add some validation to my fstruts 2 form but it won't
>> work.
>> If I enter for example value '6' in my weight textfield and press
>> 'add', the debugger comes in the method 'addProduct', finishes and
>> returns to products.jsp.
>> There is no message shown as defined in the validation xml.
>> Does someone see what goes wrong?
>>
>>
>> In products.jsp I have the following code:
>> ...
>> <s:head/>
>> </head>
>> ...
>> <s:fielderror />
>> <s:actionerror />
>> <s:form action="addProduct" method="post" validate="true"
>> namespace="/service">
>> weight: <s:textfield name="weight" />
>> <s:submit value="addProduct" align="center" cssClass="button" />
>> </s:form> ...
>>
>> In struts.xml I have:
>>
>> <action name="addProduct" class="be.shop.service.ProductActions"
>> method="addProduct" >
>> <result name="input">/products.jsp</result>
>> <result>/products.jsp</result>
>> <result name="error">/products.jsp</result>
>> </action>
>>
>> In ProductActions.java i have:
>>
>> public String addProduct(){
>> return SUCCESS;
>> }
>>
>> In ProductActions-addProduct-validation.xml I have:
>>
>> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
>> 1.0.2//EN"
>> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
>> <validators>
>> <field name="weight">
>> <field-validator type="double">
>> <param name="min">0</param>
>> <param name="max">3</param>
>> <message>Weight has to be numeric and can't be less than 0.</message>
>> </field-validator> </field> </validators>
>>
>> thx!
>>
>> Sandy
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: validation
Posted by Sa...@roularta.be.
Pawe,
Yes addProduct is called in the ProductActions in be.shop.service
It is unclear to me what I should use for 'name' and for 'namespace' in the package-tag.
It should be called right away, the validationintercepter should be progressed first.;
Sandy
-----Oorspronkelijk bericht-----
Van: Paweł Wielgus [mailto:poulwiel@gmail.com]
Verzonden: maandag 17 augustus 2009 14:35
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Hi Sandy,
is your addProduct method in ProductActions action being called?
it is unclear for me how would it happen, because You are referencing addProduct action in /service namespace which would normally be some_base_actions_package.service.AddProductAction.java
Is it done with REST?
Best greetings,
Paweł Wielgus.
2009/8/17 <Sa...@roularta.be>:
>
> I have my package
> -be.shop.service
> Which contains ProductActions.java and
> ProductActions-addProduct-validation.xml
>
> In my struts.xml i have the package tag:
> <package name="shop" extends="struts-default" namespace="/service">
>
> In my jsp page i have the form tag:
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
>
> I assume that my packagedeclaration in struts.xml isn't right?
>
> I'm not sure what the difference is between name, namespace and package?
>
>
>
>
>
> -----Oorspronkelijk bericht-----
> Van: musomesa@aol.com [mailto:musomesa@aol.com]
> Verzonden: maandag 17 augustus 2009 14:07
> Aan: user@struts.apache.org
> Onderwerp: Re: validation
>
>
> In the products.jsp you assume the action? addProduct to be in the
> "/service" namespace but? "shop" package which contains the action is
> not in the "/service" namespace.
>
> Try
>
>
>
>
> <package name="shop" namespace="/service" extends="struts-default" >
>
>
>
>
> -----Original Message-----
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 7:54 am
> Subject: RE: validation
>
>
>
>
>
>
>
>
>
>
> Yes, this is my package declaration in struts.xml:
> <package name="shop" extends="struts-default">
>
> I changed the namespace of my formtag (on the jsp page) into 'shop',
> according to the package name.
> But it doesn't help..
>
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:42
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> do you extends="struts-default" in your package?
>
> or may be just put this
> <default-interceptor-ref name="defaultStack" /> in your package to
> check
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:26:45 PM
> Subject: RE: validation
>
> Thx for the reply,
> I have no interceptors declared in my struts.xml, so I assume i use
> defaultstack interceptor, or not?
> Jes, the validation xml is in the same dir as my class.
>
> Any other thoughts?
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:12
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> Are u using defaultStack interceptor? If not u need to make sure
> validate and workflow interceptor are in your interceptor stack.
>
> Another check is are u putting the
> ProductActions-addProduct-validation.xml in the same directory as your
> ProductActions.java ?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 11:01:56 AM
> Subject: validation
>
> Hi,
>
> I'm trying to add some validation to my fstruts 2 form but it won't
> work.
> If I enter for example value '6' in my weight textfield and press
> 'add', the debugger comes in the method 'addProduct', finishes and
> returns to products.jsp.
> There is no message shown as defined in the validation xml.
> Does someone see what goes wrong?
>
>
> In products.jsp I have the following code:
> ...
> <s:head/>
> </head>
> ...
> <s:fielderror />
> <s:actionerror />
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
> weight: <s:textfield name="weight" />
> <s:submit value="addProduct" align="center" cssClass="button" />
> </s:form> ...
>
> In struts.xml I have:
>
> <action name="addProduct" class="be.shop.service.ProductActions"
> method="addProduct" >
> <result name="input">/products.jsp</result>
> <result>/products.jsp</result>
> <result name="error">/products.jsp</result>
> </action>
>
> In ProductActions.java i have:
>
> public String addProduct(){
> return SUCCESS;
> }
>
> In ProductActions-addProduct-validation.xml I have:
>
> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
> 1.0.2//EN"
> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
> <validators>
> <field name="weight">
> <field-validator type="double">
> <param name="min">0</param>
> <param name="max">3</param>
> <message>Weight has to be numeric and can't be less than 0.</message>
> </field-validator> </field> </validators>
>
> thx!
>
> Sandy
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
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: validation
Posted by Paweł Wielgus <po...@gmail.com>.
Hi Sandy,
is your addProduct method in ProductActions action being called?
it is unclear for me how would it happen,
because You are referencing addProduct action in /service namespace
which would normally be
some_base_actions_package.service.AddProductAction.java
Is it done with REST?
Best greetings,
Paweł Wielgus.
2009/8/17 <Sa...@roularta.be>:
>
> I have my package
> -be.shop.service
> Which contains ProductActions.java and
> ProductActions-addProduct-validation.xml
>
> In my struts.xml i have the package tag:
> <package name="shop" extends="struts-default" namespace="/service">
>
> In my jsp page i have the form tag:
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
>
> I assume that my packagedeclaration in struts.xml isn't right?
>
> I'm not sure what the difference is between name, namespace and package?
>
>
>
>
>
> -----Oorspronkelijk bericht-----
> Van: musomesa@aol.com [mailto:musomesa@aol.com]
> Verzonden: maandag 17 augustus 2009 14:07
> Aan: user@struts.apache.org
> Onderwerp: Re: validation
>
>
> In the products.jsp you assume the action? addProduct to be in the
> "/service" namespace but? "shop" package which contains the action is
> not in the "/service" namespace.
>
> Try
>
>
>
>
> <package name="shop" namespace="/service" extends="struts-default" >
>
>
>
>
> -----Original Message-----
> From: Sandy.Verfaille@roularta.be
> To: user@struts.apache.org
> Sent: Mon, Aug 17, 2009 7:54 am
> Subject: RE: validation
>
>
>
>
>
>
>
>
>
>
> Yes, this is my package declaration in struts.xml:
> <package name="shop" extends="struts-default">
>
> I changed the namespace of my formtag (on the jsp page) into 'shop',
> according to the package name.
> But it doesn't help..
>
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:42
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> do you extends="struts-default" in your package?
>
> or may be just put this
> <default-interceptor-ref name="defaultStack" /> in your package to check
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 12:26:45 PM
> Subject: RE: validation
>
> Thx for the reply,
> I have no interceptors declared in my struts.xml, so I assume i use
> defaultstack interceptor, or not?
> Jes, the validation xml is in the same dir as my class.
>
> Any other thoughts?
>
> -----Oorspronkelijk bericht-----
> Van: mailtolouis2020-struts@yahoo.com
> [mailto:mailtolouis2020-struts@yahoo.com]
> Verzonden: maandag 17 augustus 2009 13:12
> Aan: Struts Users Mailing List
> Onderwerp: Re: validation
>
> Are u using defaultStack interceptor? If not u need to make sure
> validate and workflow interceptor are in your interceptor stack.
>
> Another check is are u putting the
> ProductActions-addProduct-validation.xml in the same directory as your
> ProductActions.java ?
>
>
>
> ________________________________
> From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
> To: user@struts.apache.org
> Sent: Monday, August 17, 2009 11:01:56 AM
> Subject: validation
>
> Hi,
>
> I'm trying to add some validation to my fstruts 2 form but it won't
> work.
> If I enter for example value '6' in my weight textfield and press 'add',
> the debugger comes in the method 'addProduct', finishes and returns to
> products.jsp.
> There is no message shown as defined in the validation xml.
> Does someone see what goes wrong?
>
>
> In products.jsp I have the following code:
> ...
> <s:head/>
> </head>
> ...
> <s:fielderror />
> <s:actionerror />
> <s:form action="addProduct" method="post" validate="true"
> namespace="/service">
> weight: <s:textfield name="weight" />
> <s:submit value="addProduct" align="center" cssClass="button" />
> </s:form> ...
>
> In struts.xml I have:
>
> <action name="addProduct" class="be.shop.service.ProductActions"
> method="addProduct" >
> <result name="input">/products.jsp</result>
> <result>/products.jsp</result>
> <result name="error">/products.jsp</result>
> </action>
>
> In ProductActions.java i have:
>
> public String addProduct(){
> return SUCCESS;
> }
>
> In ProductActions-addProduct-validation.xml I have:
>
> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
> 1.0.2//EN"
> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
> <validators>
> <field name="weight">
> <field-validator type="double">
> <param name="min">0</param>
> <param name="max">3</param>
> <message>Weight has to be numeric and can't be less than 0.</message>
> </field-validator> </field> </validators>
>
> thx!
>
> Sandy
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Sa...@roularta.be.
I have my package
-be.shop.service
Which contains ProductActions.java and
ProductActions-addProduct-validation.xml
In my struts.xml i have the package tag:
<package name="shop" extends="struts-default" namespace="/service">
In my jsp page i have the form tag:
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
I assume that my packagedeclaration in struts.xml isn't right?
I'm not sure what the difference is between name, namespace and package?
-----Oorspronkelijk bericht-----
Van: musomesa@aol.com [mailto:musomesa@aol.com]
Verzonden: maandag 17 augustus 2009 14:07
Aan: user@struts.apache.org
Onderwerp: Re: validation
In the products.jsp you assume the action? addProduct to be in the
"/service" namespace but? "shop" package which contains the action is
not in the "/service" namespace.
Try
<package name="shop" namespace="/service" extends="struts-default" >
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 7:54 am
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by mu...@aol.com.
In the products.jsp you assume the action? addProduct to be in the "/service" namespace but? "shop" package which
contains the action is not in the "/service" namespace.
Try
<package name="shop" namespace="/service" extends="struts-default" >
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 7:54 am
Subject: RE: validation
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by Sa...@roularta.be.
Yes, this is my package declaration in struts.xml:
<package name="shop" extends="struts-default">
I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name.
But it doesn't help..
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" /> in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by ma...@yahoo.com.
do you extends="struts-default" in your package?
or may be just put this
<default-interceptor-ref name="defaultStack" />
in your package to check
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Sa...@roularta.be.
Thx, I chenged my validator to:
<field name="weight">
<field-validator type="double">
<param name="minInclusive">0</param>
<param name="maxInclusive">3</param>
<message>Weight has to be numeric and can't be less than
0.</message>
</field-validator>
</field>
But the problem isn't solved..
Should I use some tags that show the output of my validation on my form?
The fact that my debugger gets in the action, it means that my
validationinterceptor isn't reached, right?
-----Oorspronkelijk bericht-----
Van: musomesa@aol.com [mailto:musomesa@aol.com]
Verzonden: maandag 17 augustus 2009 13:46
Aan: user@struts.apache.org
Onderwerp: Re: validation
The names of the params for double validator are different from those
of int validator.
Instead of max and min your choices are
minInclusive
maxInclusive
minExclusive
maxExclusive
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 7:26 am
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
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: validation
Posted by mu...@aol.com.
The names of the params for double validator are different from those of int validator.
Instead of max and min your choices are
minInclusive
maxInclusive
minExclusive
maxExclusive
Chris
-----Original Message-----
From: Sandy.Verfaille@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 7:26 am
Subject: RE: validation
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: validation
Posted by Sa...@roularta.be.
Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.
Any other thoughts?
-----Oorspronkelijk bericht-----
Van: mailtolouis2020-struts@yahoo.com
[mailto:mailtolouis2020-struts@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation
Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form> ...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator> </field> </validators>
thx!
Sandy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: validation
Posted by ma...@yahoo.com.
Are u using defaultStack interceptor? If not u need to make sure validate and workflow interceptor are in your interceptor stack.
Another check is are u putting the ProductActions-addProduct-validation.xml in the same directory as your ProductActions.java ?
________________________________
From: "Sandy.Verfaille@roularta.be" <Sa...@roularta.be>
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation
Hi,
I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?
In products.jsp I have the following code:
...
<s:head/>
</head>
...
<s:fielderror />
<s:actionerror />
<s:form action="addProduct" method="post" validate="true"
namespace="/service">
weight: <s:textfield name="weight" />
<s:submit value="addProduct" align="center" cssClass="button" />
</s:form>
...
In struts.xml I have:
<action name="addProduct" class="be.shop.service.ProductActions"
method="addProduct" >
<result name="input">/products.jsp</result>
<result>/products.jsp</result>
<result name="error">/products.jsp</result>
</action>
In ProductActions.java i have:
public String addProduct(){
return SUCCESS;
}
In ProductActions-addProduct-validation.xml I have:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="weight">
<field-validator type="double">
<param name="min">0</param>
<param name="max">3</param>
<message>Weight has to be numeric and can't be less than 0.</message>
</field-validator>
</field>
</validators>
thx!
Sandy