Re: Validation using Struts2-spring

2020-06-04 Thread M Huzaifah
Dear All,

i am sorry, is my bad. the validation are running well. i am trying to do show 
the message error in action, but in this code the message going to the field 
with parameter named “parameterString1” and i change requiredFiled validation 
to requiredString validation in parameter Validations Annotation.

Thank You All

> On 4 Jun 2020, at 12.00, M Huzaifah  wrote:
> 
> Hii Guys,
> 
> i’am stuck with Validation in Struts2 using struts2-spring plugin. 
> struts version : 2.5.22
> spring version : 5.2.1.RELEASE
> 
> my validators.xml in classpath:
> 
> 
>  "-//Apache Struts//XWork Validator Definition 1.0//EN"
> "http://struts.apache.org/dtds/xwork-validator-definition-1.0.dtd 
> ">
> 
>  class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
>  class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
>  class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/>
> 
> 
> 
> my struts.xml config form constant Struts-spring:
> 
> 
> 
> 
> 
> 
> 
> my validation method using Annotation
> 
> 
>   //validation
>   @Validations( requiredFields = {
>   @RequiredFieldValidator(type = ValidatorType.SIMPLE, 
> fieldName = "parameterString1", message = "You must enter a value for field.")
>   }
>   )
>   @Action(value = "testingValidation", results = {
>   @Result(name = "success", location = 
> "/pages/blank.jsp"),
>   @Result(name = "input", location = "/pages/blank.jsp"),
>   @Result(name = "error", location = "/pages/blank.jsp") 
> },
>   interceptorRefs = {
>   @InterceptorRef("validation")
>   })
>   public String testingValidation() {
>   List a = new ArrayList();
>   a.add("salah field");
>   setActionMessages(a);
>   return SUCCESS;
>   }
> 
> when i hit the URL http://localhost:8080/baseapp/example/testingValidation 
> (without parameter) 
> it does’t show my error message, the error should shown using 
>  tag in JSP.
> 
> when i trace the log, here i found:
> 
> 
> [http-nio-8080-exec-6] DEBUG 
> com.opensymphony.xwork2.validator.ValidationInterceptor - Validating 
> /example/testingValidation with method testingValidation.
> [http-nio-8080-exec-6] TRACE 
> org.springframework.beans.factory.support.DefaultListableBeanFactory - Not 
> autowiring property 'textProviderFactory' of bean 
> 'com.opensymphony.xwork2.validator.validators.RequiredFieldValidator' by 
> name: no matching bean found
> [http-nio-8080-exec-6] TRACE 
> org.springframework.beans.factory.support.DefaultListableBeanFactory - Not 
> autowiring property 'validatorContext' of bean 
> 'com.opensymphony.xwork2.validator.validators.RequiredFieldValidator' by 
> name: no matching bean found
> [http-nio-8080-exec-6] TRACE 
> org.springframework.beans.factory.support.DefaultListableBeanFactory - Not 
> autowiring property 'valueStack' of bean 
> 'com.opensymphony.xwork2.validator.validators.RequiredFieldValidator' by 
> name: no matching bean found
> 
> the spring nt autowiring validation.
> 
> 
> 
> 
> 
> 
> 



Re: validation checkboxlist

2018-01-09 Thread José Antonio Delgado Trujillo
Upss
unbalanced ]
the para-name was autocorrection of the email editor!!!
thanks 

Un saludo,
José A.

> On 9 Jan 2018, at 14:45, Brian Holzer  wrote:
> 
> Hey there,
>I'm not sure if this is affecting anything, but the syntax appears to be 
> wrong for your 

Re: validation checkboxlist

2018-01-09 Thread José Antonio Delgado Trujillo
solved!!!

It was a problem with unbalanced ]

Un saludo,
José A.



Re: validation checkboxlist

2018-01-09 Thread Brian Holzer
Hey there,
   I'm not sure if this is affecting anything, but the syntax appears
to be wrong for your 

Re: validation checkboxlist

2018-01-08 Thread Lukasz Lenart
2018-01-08 20:04 GMT+01:00 José Antonio Delgado Trujillo :
> 

Re: validation checkboxlist

2018-01-08 Thread José Antonio Delgado Trujillo
Thanks a lot Lukasz,

I had the same like the example except the expression of the validation.
I misunderstood the param-name=“expression” - It was the expression to 
evaluate!!! (i was thinking about the expression to fail the validation) 


>> 

Re: validation checkboxlist

2018-01-07 Thread Lukasz Lenart
2018-01-05 19:26 GMT+01:00 José Antonio Delgado Trujillo :
> Why not key? i have the correspondan property files
> personBean.levels=Cursos
>
> I also see the label Cursos and the options

Ok, but please be aware that the most important thing is a "name"
attribute that must match the corresponding bean name and its
property.

>
> The problem is about the XML validation.
> 
>  
>   
> 

Re: validation checkboxlist

2018-01-05 Thread José Antonio Delgado Trujillo
> “personBean.levels.isEmpty”


Yes, it’s empty an in the form the first time rendered all the options are 
unchecked.


> 
> You should use "name" instead of "key"

Why not key? i have the correspondan property files
personBean.levels=Cursos

I also see the label Cursos and the options

The problem is about the XML validation.

 
  

Re: validation checkboxlist

2018-01-04 Thread Lukasz Lenart
2018-01-04 18:53 GMT+01:00 José Antonio Delgado Trujillo :
>   
> 

Re: validation checkboxlist

2018-01-04 Thread José Antonio Delgado Trujillo
OK,
Thanks for your explanation, i see clearer to use modeldriven or not.
My problem is not about the populate the options of the checkboxlist but the 
exception rule you must select at least one.

In the XML file i have


 
  

Re: validation checkboxlist

2018-01-04 Thread Lukasz Lenart
2018-01-04 13:24 GMT+01:00 José Antonio Delgado Trujillo :
> In the docs about model driven
> https://struts.apache.org/core-developers/model-driven.html 
> 
>
> It is said that you must to implement the MovelDriven interface just the 
> method getModel() to give an Object in which Struts populate with the 
> parameters request and placed on the top.

When using the ModelDriven interface, your top object on a stack will
be the Object, not an Action, so:
- with ModelDriven:  => person.levels (if
getModel() returns Person)
- without ModelDriven:  => levels (ia
property on an action level)

All OGNL expressions/tags are searching stack from the op to the
bottom, the top most object on the stack is always an action but
ModelDriven changes that, and a Model is the top most object on the
stack.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation checkboxlist

2018-01-04 Thread José Antonio Delgado Trujillo
In the docs about model driven
https://struts.apache.org/core-developers/model-driven.html 


It is said that you must to implement the MovelDriven interface just the method 
getModel() to give an Object in which Struts populate with the parameters 
request and placed on the top.

i din’t understand the need of that because i can populate the object if it is 
a field of the Action’s class.

So what is the difference (the use of OGNL?) i can’t accede object properties?

My object person is of type Person class and it is a field of the action 
Register. Why can’t access to levels property of the object person by 
person.levels??



Re: validation checkboxlist

2018-01-04 Thread Lukasz Lenart
2018-01-03 10:30 GMT+01:00 José Antonio Delgado Trujillo :
>

Do you use ModelDriven? because this looks like linked directly to an action


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: Validation using annotations with two execute methods are applied always

2015-12-17 Thread Adam Brin
You might be better off splitting the two actions into two different
classes. As far as I know that's the only way to address the issue. If you
have shared logic or fields, you can always put those in a superclass.

On Thu, Dec 17, 2015 at 3:28 PM, JOSE L MARTINEZ-AVIAL 
wrote:

> Hello,
>  I'm using Struts 2.3.24.1. I have an action that has two execute
> methods, and it is used by two actions, as follows:
>
>  class="com.xxx.EasyEnrollmentCreateClient" method="createUserForClient">
>  class="com.xxx.EasyEnrollmentCreateClient" method="createUserForParty">
>
>
> Each method has its own validations, defined by annotations at the method
> level.
>
> @Validations(requiredStrings = {
> @RequiredStringValidator(fieldName="idLanguage", key =
> "validation-error.mandatory", messageParams={"getText('idLanguage')"}),
> @RequiredStringValidator(fieldName="idCompany", key =
> "validation-error.mandatory", messageParams={"getText('idCompany')"}),
> @RequiredStringValidator(fieldName="idParty", key =
> "validation-error.mandatory", messageParams={"getText('idParty')"})})
> public String createUserForParty() throws Exception {
>
>
>
> @Validations(requiredStrings = {
> @RequiredStringValidator(fieldName="idLanguage", key =
> "validation-error.mandatory", messageParams={"getText('idLanguage')"}),
> @RequiredStringValidator(fieldName="idCompany", key =
> "validation-error.mandatory", messageParams={"getText('idCompany')"}),
> @RequiredStringValidator(fieldName="idCustomer", key =
> "validation-error.mandatory", messageParams={"getText('idCustomer')"})})
> public String createUserForClient() throws Exception {
>
>
> The issue is that both sets of validations are always executed, no matter
> which action has been called. And I see in the response that when
> idLanguage or idCompany are missing, the error appears twice, since it is
> requited in both actions.
>
> What am I doing wrong?
>
> Regards
>
> JL
>



-- 
_
Adam Brin
Director of Technology, Digital Antiquity
480.965.1278


Re: Validation using annotations with two execute methods are applied always

2015-12-17 Thread Łukasz Lenart
What about switching validateAnnotatedMethodOnly? This is going to be
default in 2.5 probably

https://struts.apache.org/docs/validations-annotation.html

(mobile)
17 gru 2015 23:29 "JOSE L MARTINEZ-AVIAL"  napisał(a):

> Hello,
>  I'm using Struts 2.3.24.1. I have an action that has two execute
> methods, and it is used by two actions, as follows:
>
>  class="com.xxx.EasyEnrollmentCreateClient" method="createUserForClient">
>  class="com.xxx.EasyEnrollmentCreateClient" method="createUserForParty">
>
>
> Each method has its own validations, defined by annotations at the method
> level.
>
> @Validations(requiredStrings = {
> @RequiredStringValidator(fieldName="idLanguage", key =
> "validation-error.mandatory", messageParams={"getText('idLanguage')"}),
> @RequiredStringValidator(fieldName="idCompany", key =
> "validation-error.mandatory", messageParams={"getText('idCompany')"}),
> @RequiredStringValidator(fieldName="idParty", key =
> "validation-error.mandatory", messageParams={"getText('idParty')"})})
> public String createUserForParty() throws Exception {
>
>
>
> @Validations(requiredStrings = {
> @RequiredStringValidator(fieldName="idLanguage", key =
> "validation-error.mandatory", messageParams={"getText('idLanguage')"}),
> @RequiredStringValidator(fieldName="idCompany", key =
> "validation-error.mandatory", messageParams={"getText('idCompany')"}),
> @RequiredStringValidator(fieldName="idCustomer", key =
> "validation-error.mandatory", messageParams={"getText('idCustomer')"})})
> public String createUserForClient() throws Exception {
>
>
> The issue is that both sets of validations are always executed, no matter
> which action has been called. And I see in the response that when
> idLanguage or idCompany are missing, the error appears twice, since it is
> requited in both actions.
>
> What am I doing wrong?
>
> Regards
>
> JL
>


Re: validation problem

2014-12-26 Thread Yaragalla Muralidhar
Hi Sreekanth,
   sorry to say this. I tried everything stated in the example that u gave.
but it did not work for me. I am doing something wrong but could not find
out what. Thank u for all your help.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Fri, Dec 26, 2014 at 12:24 PM, Sreekanth S. Nair 
sreekanth.n...@egovernments.org wrote:

 I couldn't make your sample war run at all, please find the attached
 sample war which is working for me in tomcat 7 (struts2 jars and other dep
 not included). You can follow the directory structure and naming convention
 and try to do the same in your project. Do not add @SkipValidation
 annotation in your save or submit method (@SkipValidation will in fact
 ignore validation for it)

 --
 Thanks  Regards

 Sreekanth S Nair
 Java Developer
 ---
 eGovernments Foundation http://www.egovernments.org
 Ph : 9980078913
 ---
 http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
 https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
 sreekanths...@gmail.com
 ---

 On Fri, Dec 26, 2014 at 11:32 AM, Sreekanth S. Nair 
 sreekanth.n...@egovernments.org wrote:

 Ok let me try and will get back to you...


 On Fri, Dec 26, 2014 at 11:26 AM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 Hi Sreekanth,
   I think i cannot send attachements to the mailing list so i have
 uploaded the project to my drive and sharing the link


 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing


 i am using tomcat 7.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Fri, Dec 26, 2014 at 9:32 AM, Sreekanth S. Nair 
 sreekanth.n...@egovernments.org wrote:

  Can you share a sample project which is not working, and just let me
 know
  which server you are trying..?
 
  --
  Thanks  Regards
 
  Sreekanth S Nair
  Java Developer
  ---
  eGovernments Foundation http://www.egovernments.org
  Ph : 9980078913
  ---
  http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
  https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
  sreekanths...@gmail.com
  ---
 
  On Fri, Dec 26, 2014 at 9:10 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi sreekanth,
  I have changed the names as u suggested but it did not
 work. i
   have read the link u posted and i did everything that the link says.
 i
  have
   debugged as well. it is not throwing any error.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
   sreekanth.n...@egovernments.org wrote:
  
As Dave said, kindly show some patience.
   
First of validation is nothing to do with theme so just leave the
 theme
alone.
   
1) Can you try renaming the action class name from SampleRegOne to
SampleRegOneAction
and same in struts.xml
   
2) If you give action alias name like below,
 action name=sampleRegOne
class=com.zedlabs.samplereg.action.SampleRegOne 
   
as far as i understood you need to use the alias name suffixed
 along
  with
the action class name so in essence your validator xml name should
 be
   some
thing like below
   
SampleRegOne-sampleRegOne-validation.xml
   
Since i don't have much knowledge in xml based validation i
 recommend
  you
to read upon struts2 xml based validation from the below link
   
   
  
 
 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml
   
If the above solution is not working then try and figure out the
  problem
   by
debugging through struts2 source.
   
If the above solutions couldn't resolve your problem then get some
  debug
level log of struts2 while accessing that particular action and
 post it
over here.
   
   
   
   
On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton 
 davelnew...@gmail.com
wrote:
   
 Unrelated to the technical issue: bear in mind the mailing list
 is a
 volunteer-staffed resource. Nobody is deliberately delaying a
 response. We already know you need help. In the US, at least,
 it's a
 fairly major holiday, and people are doing things besides trying
 to
 reproduce your environment and code to help out.

 With that in mind, please be patient.


 On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  kindly help me solve this issue
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/
 *
 
  On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla 

Re: validation problem

2014-12-26 Thread Sreekanth S. Nair
There is nothing about sorry, i guess your action package structure or
something is wrong, i recommend you to run the sample war i have attached
in tomcat 7 and see the result (make sure to include strust2 latest lib to
its WEB-INF/lib). Try adding your action class one by one to that sample
and try again.




On Fri, Dec 26, 2014 at 3:07 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 Hi Sreekanth,
sorry to say this. I tried everything stated in the example that u gave.
 but it did not work for me. I am doing something wrong but could not find
 out what. Thank u for all your help.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Fri, Dec 26, 2014 at 12:24 PM, Sreekanth S. Nair 
 sreekanth.n...@egovernments.org wrote:

  I couldn't make your sample war run at all, please find the attached
  sample war which is working for me in tomcat 7 (struts2 jars and other
 dep
  not included). You can follow the directory structure and naming
 convention
  and try to do the same in your project. Do not add @SkipValidation
  annotation in your save or submit method (@SkipValidation will in fact
  ignore validation for it)
 
  --
  Thanks  Regards
 
  Sreekanth S Nair
  Java Developer
  ---
  eGovernments Foundation http://www.egovernments.org
  Ph : 9980078913
  ---
  http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
  https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
  sreekanths...@gmail.com
  ---
 
  On Fri, Dec 26, 2014 at 11:32 AM, Sreekanth S. Nair 
  sreekanth.n...@egovernments.org wrote:
 
  Ok let me try and will get back to you...
 
 
  On Fri, Dec 26, 2014 at 11:26 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
  Hi Sreekanth,
I think i cannot send attachements to the mailing list so i have
  uploaded the project to my drive and sharing the link
 
 
 
 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing
 
 
  i am using tomcat 7.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Fri, Dec 26, 2014 at 9:32 AM, Sreekanth S. Nair 
  sreekanth.n...@egovernments.org wrote:
 
   Can you share a sample project which is not working, and just let me
  know
   which server you are trying..?
  
   --
   Thanks  Regards
  
   Sreekanth S Nair
   Java Developer
   ---
   eGovernments Foundation http://www.egovernments.org
   Ph : 9980078913
   ---
   http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
   https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
   sreekanths...@gmail.com
   ---
  
   On Fri, Dec 26, 2014 at 9:10 AM, Yaragalla Muralidhar 
   yaragallamur...@gmail.com wrote:
  
Hi sreekanth,
   I have changed the names as u suggested but it did not
  work. i
have read the link u posted and i did everything that the link
 says.
  i
   have
debugged as well. it is not throwing any error.
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
sreekanth.n...@egovernments.org wrote:
   
 As Dave said, kindly show some patience.

 First of validation is nothing to do with theme so just leave the
  theme
 alone.

 1) Can you try renaming the action class name from SampleRegOne
 to
 SampleRegOneAction
 and same in struts.xml

 2) If you give action alias name like below,
  action name=sampleRegOne
 class=com.zedlabs.samplereg.action.SampleRegOne 

 as far as i understood you need to use the alias name suffixed
  along
   with
 the action class name so in essence your validator xml name
 should
  be
some
 thing like below

 SampleRegOne-sampleRegOne-validation.xml

 Since i don't have much knowledge in xml based validation i
  recommend
   you
 to read upon struts2 xml based validation from the below link


   
  
 
 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml

 If the above solution is not working then try and figure out the
   problem
by
 debugging through struts2 source.

 If the above solutions couldn't resolve your problem then get
 some
   debug
 level log of struts2 while accessing that particular action and
  post it
 over here.




 On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton 
  davelnew...@gmail.com
 wrote:

  Unrelated to the technical issue: bear in mind the mailing list
  is a
  volunteer-staffed resource. Nobody is deliberately delaying a
  response. We already know 

Re: validation problem

2014-12-26 Thread Yaragalla Muralidhar
I will do that. Thank you so much.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Fri, Dec 26, 2014 at 3:14 PM, Sreekanth S. Nair 
sreekanth.n...@egovernments.org wrote:

 There is nothing about sorry, i guess your action package structure or
 something is wrong, i recommend you to run the sample war i have attached
 in tomcat 7 and see the result (make sure to include strust2 latest lib to
 its WEB-INF/lib). Try adding your action class one by one to that sample
 and try again.




 On Fri, Dec 26, 2014 at 3:07 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

  Hi Sreekanth,
 sorry to say this. I tried everything stated in the example that u
 gave.
  but it did not work for me. I am doing something wrong but could not find
  out what. Thank u for all your help.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Fri, Dec 26, 2014 at 12:24 PM, Sreekanth S. Nair 
  sreekanth.n...@egovernments.org wrote:
 
   I couldn't make your sample war run at all, please find the attached
   sample war which is working for me in tomcat 7 (struts2 jars and other
  dep
   not included). You can follow the directory structure and naming
  convention
   and try to do the same in your project. Do not add @SkipValidation
   annotation in your save or submit method (@SkipValidation will in fact
   ignore validation for it)
  
   --
   Thanks  Regards
  
   Sreekanth S Nair
   Java Developer
   ---
   eGovernments Foundation http://www.egovernments.org
   Ph : 9980078913
   ---
   http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
   https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
   sreekanths...@gmail.com
   ---
  
   On Fri, Dec 26, 2014 at 11:32 AM, Sreekanth S. Nair 
   sreekanth.n...@egovernments.org wrote:
  
   Ok let me try and will get back to you...
  
  
   On Fri, Dec 26, 2014 at 11:26 AM, Yaragalla Muralidhar 
   yaragallamur...@gmail.com wrote:
  
   Hi Sreekanth,
 I think i cannot send attachements to the mailing list so i
 have
   uploaded the project to my drive and sharing the link
  
  
  
 
 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing
  
  
   i am using tomcat 7.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Fri, Dec 26, 2014 at 9:32 AM, Sreekanth S. Nair 
   sreekanth.n...@egovernments.org wrote:
  
Can you share a sample project which is not working, and just let
 me
   know
which server you are trying..?
   
--
Thanks  Regards
   
Sreekanth S Nair
Java Developer
---
eGovernments Foundation http://www.egovernments.org
Ph : 9980078913
---
http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
https://github.com/sreekanthsnair   
 sreekanthsn...@hotmail.co.uk
sreekanths...@gmail.com
---
   
On Fri, Dec 26, 2014 at 9:10 AM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:
   
 Hi sreekanth,
I have changed the names as u suggested but it did not
   work. i
 have read the link u posted and i did everything that the link
  says.
   i
have
 debugged as well. it is not throwing any error.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
 sreekanth.n...@egovernments.org wrote:

  As Dave said, kindly show some patience.
 
  First of validation is nothing to do with theme so just leave
 the
   theme
  alone.
 
  1) Can you try renaming the action class name from SampleRegOne
  to
  SampleRegOneAction
  and same in struts.xml
 
  2) If you give action alias name like below,
   action name=sampleRegOne
  class=com.zedlabs.samplereg.action.SampleRegOne 
 
  as far as i understood you need to use the alias name suffixed
   along
with
  the action class name so in essence your validator xml name
  should
   be
 some
  thing like below
 
  SampleRegOne-sampleRegOne-validation.xml
 
  Since i don't have much knowledge in xml based validation i
   recommend
you
  to read upon struts2 xml based validation from the below link
 
 

   
  
 
 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml
 
  If the above solution is not working then try and figure out
 the
problem
 by
  debugging through struts2 source.
 
  If the above solutions couldn't resolve your problem then get
  

Re: validation problem

2014-12-26 Thread Lukasz Lenart
2014-12-26 6:56 GMT+01:00 Yaragalla Muralidhar yaragallamur...@gmail.com:
 Hi Sreekanth,
   I think i cannot send attachements to the mailing list so i have
 uploaded the project to my drive and sharing the link

 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing

Can you pack all the files with zip or something like that and share
the archive?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation problem

2014-12-26 Thread Lukasz Lenart
2014-12-26 15:19 GMT+01:00 Lukasz Lenart lukaszlen...@apache.org:
 2014-12-26 6:56 GMT+01:00 Yaragalla Muralidhar yaragallamur...@gmail.com:
 Hi Sreekanth,
   I think i cannot send attachements to the mailing list so i have
 uploaded the project to my drive and sharing the link

 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing

 Can you pack all the files with zip or something like that and share
 the archive?

Nvm, got it :)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation problem

2014-12-26 Thread Lukasz Lenart
2014-12-26 15:19 GMT+01:00 Lukasz Lenart lukaszlen...@apache.org:
 2014-12-26 6:56 GMT+01:00 Yaragalla Muralidhar yaragallamur...@gmail.com:
 Hi Sreekanth,
   I think i cannot send attachements to the mailing list so i have
 uploaded the project to my drive and sharing the link

 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing

Can you start that app? I've noticed include
file=mailreader-default.xml/ in sample-reg.xml but such file
doesn't exist which means Struts will blow up with some error in the
logs.

Another thing, even empty text field means something - an empty string
- if you read the docs [1] it will clearly says:
RequiredFieldValidator checks if the specified field is not null.
where empty string != null

I think you want to specify min length of the String so you should use
stringlength [2] instead. One more remark: you don't have to put
validators.xml - it's only needed when you define your own validators.
And I kindly suggest, please re-read the docs about how to setup
validation and what each of the validators do [3].

[1] http://struts.apache.org/docs/required-validator.html
[2] http://struts.apache.org/docs/stringlength-validator.html
[3] http://struts.apache.org/docs/validation.html


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation problem

2014-12-26 Thread Yaragalla Muralidhar
Thank you Lukasz. I have rectified all the mistakes that u listed.
Validations are working. I also have done some simple mistakes. I have
rectified all the mistakes. Everything is working fine now. Thanks to all
of you.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Fri, Dec 26, 2014 at 8:09 PM, Lukasz Lenart lukaszlen...@apache.org
wrote:

 2014-12-26 15:19 GMT+01:00 Lukasz Lenart lukaszlen...@apache.org:
  2014-12-26 6:56 GMT+01:00 Yaragalla Muralidhar 
 yaragallamur...@gmail.com:
  Hi Sreekanth,
I think i cannot send attachements to the mailing list so i have
  uploaded the project to my drive and sharing the link
 
 
 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing

 Can you start that app? I've noticed include
 file=mailreader-default.xml/ in sample-reg.xml but such file
 doesn't exist which means Struts will blow up with some error in the
 logs.

 Another thing, even empty text field means something - an empty string
 - if you read the docs [1] it will clearly says:
 RequiredFieldValidator checks if the specified field is not null.
 where empty string != null

 I think you want to specify min length of the String so you should use
 stringlength [2] instead. One more remark: you don't have to put
 validators.xml - it's only needed when you define your own validators.
 And I kindly suggest, please re-read the docs about how to setup
 validation and what each of the validators do [3].

 [1] http://struts.apache.org/docs/required-validator.html
 [2] http://struts.apache.org/docs/stringlength-validator.html
 [3] http://struts.apache.org/docs/validation.html


 Regards
 --
 Łukasz
 + 48 606 323 122 http://www.lenart.org.pl/

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




Re: validation problem

2014-12-26 Thread Lukasz Lenart
2014-12-26 18:25 GMT+01:00 Yaragalla Muralidhar yaragallamur...@gmail.com:
 Thank you Lukasz. I have rectified all the mistakes that u listed.
 Validations are working. I also have done some simple mistakes. I have
 rectified all the mistakes. Everything is working fine now. Thanks to all
 of you.

Great to hear that!


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
I am using struts2.3.20 and using simple theme.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 Hi i am having problem in turning on validations. I have written
 actionClass-validation.xml file in the same package as action class.  but
 the validations are not working. the following is my validation xml file.

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.3//EN
 http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
 validators

 field name=primaryDetails.branchId
  field-validator type=required
message key=error.additional.details.passport.noCould not find
 error.additional.details.passport.no!/message
  /field-validator
  field-validator type=regex
   param name=regex![CDATA[[1-9]{0,40}]]/param
message key=error.additional.details.pancard.noCould not find
 error.additional.details.pancard.no/message
  /field-validator
 /field
  field name=primaryDetails.patientName
  field-validator type=required
message key=error.additional.details.passport.noCould not find
 error.additional.details.passport.no!/message
  /field-validator

 /field

 /validators

 do i have to do something else to turn on validations?


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*



Re: validation problem

2014-12-25 Thread Dave Newton
Simple theme is simpler than you think.
On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar yaragallamur...@gmail.com
wrote:

 I am using struts2.3.20 and using simple theme.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

  Hi i am having problem in turning on validations. I have written
  actionClass-validation.xml file in the same package as action class.
 but
  the validations are not working. the following is my validation xml file.
 
  !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.3//EN
  http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
  validators
 
  field name=primaryDetails.branchId
   field-validator type=required
 message key=error.additional.details.passport.noCould not
 find
  error.additional.details.passport.no!/message
   /field-validator
   field-validator type=regex
param name=regex![CDATA[[1-9]{0,40}]]/param
 message key=error.additional.details.pancard.noCould not find
  error.additional.details.pancard.no/message
   /field-validator
  /field
   field name=primaryDetails.patientName
   field-validator type=required
 message key=error.additional.details.passport.noCould not
 find
  error.additional.details.passport.no!/message
   /field-validator
 
  /field
 
  /validators
 
  do i have to do something else to turn on validations?
 
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 



Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
is it because of the simple theam? In simple theam validations dont happen
is it? if i dont use simple theme view components are generating their own
decoration. Our custom alignment is going wrong.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com wrote:

 Simple theme is simpler than you think.
 On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar yaragallamur...@gmail.com
 
 wrote:

  I am using struts2.3.20 and using simple theme.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi i am having problem in turning on validations. I have written
   actionClass-validation.xml file in the same package as action class.
  but
   the validations are not working. the following is my validation xml
 file.
  
   !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
 1.0.3//EN
   http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
   validators
  
   field name=primaryDetails.branchId
field-validator type=required
  message key=error.additional.details.passport.noCould not
  find
   error.additional.details.passport.no!/message
/field-validator
field-validator type=regex
 param name=regex![CDATA[[1-9]{0,40}]]/param
  message key=error.additional.details.pancard.noCould not
 find
   error.additional.details.pancard.no/message
/field-validator
   /field
field name=primaryDetails.patientName
field-validator type=required
  message key=error.additional.details.passport.noCould not
  find
   error.additional.details.passport.no!/message
/field-validator
  
   /field
  
   /validators
  
   do i have to do something else to turn on validations?
  
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
 



Re: validation problem

2014-12-25 Thread Dave Newton
Please read up on the themes.

Nutshell: validation happens (this is trivially provable), validation
message display does not.

On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
yaragallamur...@gmail.com wrote:
 is it because of the simple theam? In simple theam validations dont happen
 is it? if i dont use simple theme view components are generating their own
 decoration. Our custom alignment is going wrong.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com wrote:

 Simple theme is simpler than you think.
 On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar yaragallamur...@gmail.com
 
 wrote:

  I am using struts2.3.20 and using simple theme.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi i am having problem in turning on validations. I have written
   actionClass-validation.xml file in the same package as action class.
  but
   the validations are not working. the following is my validation xml
 file.
  
   !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
 1.0.3//EN
   http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
   validators
  
   field name=primaryDetails.branchId
field-validator type=required
  message key=error.additional.details.passport.noCould not
  find
   error.additional.details.passport.no!/message
/field-validator
field-validator type=regex
 param name=regex![CDATA[[1-9]{0,40}]]/param
  message key=error.additional.details.pancard.noCould not
 find
   error.additional.details.pancard.no/message
/field-validator
   /field
field name=primaryDetails.patientName
field-validator type=required
  message key=error.additional.details.passport.noCould not
  find
   error.additional.details.passport.no!/message
/field-validator
  
   /field
  
   /validators
  
   do i have to do something else to turn on validations?
  
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
 




-- 
e: davelnew...@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton
b: Bucky Bits
g: davelnewton
so: Dave Newton

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



Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
in my case validations are not happenening . Even though validation fails
it is moving to succeess rather than input jsp.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com wrote:

 Please read up on the themes.

 Nutshell: validation happens (this is trivially provable), validation
 message display does not.

 On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  is it because of the simple theam? In simple theam validations dont
 happen
  is it? if i dont use simple theme view components are generating their
 own
  decoration. Our custom alignment is going wrong.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Simple theme is simpler than you think.
  On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com
  
  wrote:
 
   I am using struts2.3.20 and using simple theme.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
   yaragallamur...@gmail.com wrote:
  
Hi i am having problem in turning on validations. I have written
actionClass-validation.xml file in the same package as action
 class.
   but
the validations are not working. the following is my validation xml
  file.
   
!DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
  1.0.3//EN
http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
validators
   
field name=primaryDetails.branchId
 field-validator type=required
   message key=error.additional.details.passport.noCould
 not
   find
error.additional.details.passport.no!/message
 /field-validator
 field-validator type=regex
  param name=regex![CDATA[[1-9]{0,40}]]/param
   message key=error.additional.details.pancard.noCould not
  find
error.additional.details.pancard.no/message
 /field-validator
/field
 field name=primaryDetails.patientName
 field-validator type=required
   message key=error.additional.details.passport.noCould
 not
   find
error.additional.details.passport.no!/message
 /field-validator
   
/field
   
/validators
   
do i have to do something else to turn on validations?
   
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
  
 



 --
 e: davelnew...@gmail.com
 m: 908-380-8699
 s: davelnewton_skype
 t: @dave_newton
 b: Bucky Bits
 g: davelnewton
 so: Dave Newton

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




Re: validation problem

2014-12-25 Thread Dave Newton
Then you're doing something else wrong; never mind.

You still won't see the messages unless you display them manually.

On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
yaragallamur...@gmail.com wrote:
 in my case validations are not happenening . Even though validation fails
 it is moving to succeess rather than input jsp.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com wrote:

 Please read up on the themes.

 Nutshell: validation happens (this is trivially provable), validation
 message display does not.

 On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  is it because of the simple theam? In simple theam validations dont
 happen
  is it? if i dont use simple theme view components are generating their
 own
  decoration. Our custom alignment is going wrong.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Simple theme is simpler than you think.
  On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com
  
  wrote:
 
   I am using struts2.3.20 and using simple theme.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
   yaragallamur...@gmail.com wrote:
  
Hi i am having problem in turning on validations. I have written
actionClass-validation.xml file in the same package as action
 class.
   but
the validations are not working. the following is my validation xml
  file.
   
!DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
  1.0.3//EN
http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
validators
   
field name=primaryDetails.branchId
 field-validator type=required
   message key=error.additional.details.passport.noCould
 not
   find
error.additional.details.passport.no!/message
 /field-validator
 field-validator type=regex
  param name=regex![CDATA[[1-9]{0,40}]]/param
   message key=error.additional.details.pancard.noCould not
  find
error.additional.details.pancard.no/message
 /field-validator
/field
 field name=primaryDetails.patientName
 field-validator type=required
   message key=error.additional.details.passport.noCould
 not
   find
error.additional.details.passport.no!/message
 /field-validator
   
/field
   
/validators
   
do i have to do something else to turn on validations?
   
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
  
 



 --
 e: davelnew...@gmail.com
 m: 908-380-8699
 s: davelnewton_skype
 t: @dave_newton
 b: Bucky Bits
 g: davelnewton
 so: Dave Newton

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





-- 
e: davelnew...@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton
b: Bucky Bits
g: davelnewton
so: Dave Newton

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



Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
if the validation works then i can think about messages

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 I have changed the theme to css_xhtml   so it should display right?

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:28 PM, Dave Newton davelnew...@gmail.com
 wrote:

 Then you're doing something else wrong; never mind.

 You still won't see the messages unless you display them manually.

 On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  in my case validations are not happenening . Even though validation
 fails
  it is moving to succeess rather than input jsp.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Please read up on the themes.
 
  Nutshell: validation happens (this is trivially provable), validation
  message display does not.
 
  On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
  yaragallamur...@gmail.com wrote:
   is it because of the simple theam? In simple theam validations dont
  happen
   is it? if i dont use simple theme view components are generating
 their
  own
   decoration. Our custom alignment is going wrong.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com
  wrote:
  
   Simple theme is simpler than you think.
   On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com
   
   wrote:
  
I am using struts2.3.20 and using simple theme.
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:
   
 Hi i am having problem in turning on validations. I have written
 actionClass-validation.xml file in the same package as action
  class.
but
 the validations are not working. the following is my validation
 xml
   file.

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
   1.0.3//EN
 
 http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
 validators

 field name=primaryDetails.branchId
  field-validator type=required
message key=error.additional.details.passport.no
 Could
  not
find
 error.additional.details.passport.no!/message
  /field-validator
  field-validator type=regex
   param name=regex![CDATA[[1-9]{0,40}]]/param
message key=error.additional.details.pancard.noCould
 not
   find
 error.additional.details.pancard.no/message
  /field-validator
 /field
  field name=primaryDetails.patientName
  field-validator type=required
message key=error.additional.details.passport.no
 Could
  not
find
 error.additional.details.passport.no!/message
  /field-validator

 /field

 /validators

 do i have to do something else to turn on validations?


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

   
  
 
 
 
  --
  e: davelnew...@gmail.com
  m: 908-380-8699
  s: davelnewton_skype
  t: @dave_newton
  b: Bucky Bits
  g: davelnewton
  so: Dave Newton
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 e: davelnew...@gmail.com
 m: 908-380-8699
 s: davelnewton_skype
 t: @dave_newton
 b: Bucky Bits
 g: davelnewton
 so: Dave Newton

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





Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
I have changed the theme to css_xhtml   so it should display right?

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 6:28 PM, Dave Newton davelnew...@gmail.com wrote:

 Then you're doing something else wrong; never mind.

 You still won't see the messages unless you display them manually.

 On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  in my case validations are not happenening . Even though validation fails
  it is moving to succeess rather than input jsp.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Please read up on the themes.
 
  Nutshell: validation happens (this is trivially provable), validation
  message display does not.
 
  On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
  yaragallamur...@gmail.com wrote:
   is it because of the simple theam? In simple theam validations dont
  happen
   is it? if i dont use simple theme view components are generating their
  own
   decoration. Our custom alignment is going wrong.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com
  wrote:
  
   Simple theme is simpler than you think.
   On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com
   
   wrote:
  
I am using struts2.3.20 and using simple theme.
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:
   
 Hi i am having problem in turning on validations. I have written
 actionClass-validation.xml file in the same package as action
  class.
but
 the validations are not working. the following is my validation
 xml
   file.

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
   1.0.3//EN
 http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd
 
 validators

 field name=primaryDetails.branchId
  field-validator type=required
message key=error.additional.details.passport.noCould
  not
find
 error.additional.details.passport.no!/message
  /field-validator
  field-validator type=regex
   param name=regex![CDATA[[1-9]{0,40}]]/param
message key=error.additional.details.pancard.noCould
 not
   find
 error.additional.details.pancard.no/message
  /field-validator
 /field
  field name=primaryDetails.patientName
  field-validator type=required
message key=error.additional.details.passport.noCould
  not
find
 error.additional.details.passport.no!/message
  /field-validator

 /field

 /validators

 do i have to do something else to turn on validations?


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

   
  
 
 
 
  --
  e: davelnew...@gmail.com
  m: 908-380-8699
  s: davelnewton_skype
  t: @dave_newton
  b: Bucky Bits
  g: davelnewton
  so: Dave Newton
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 e: davelnew...@gmail.com
 m: 908-380-8699
 s: davelnewton_skype
 t: @dave_newton
 b: Bucky Bits
 g: davelnewton
 so: Dave Newton

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




Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
The following is my action class

package com.zedlabs.samplereg.action;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.zedlabs.action.ZedActionSupport;
import com.zedlabs.samplereg.dto.PDDto;
import com.zedlabs.samplereg.service.SampleRegService;
import com.zedlabs.samplereg.service.SampleRegServiceImpl;

public class SampleRegOne extends ZedActionSupport {

private static final long serialVersionUID = -8621676046564513353L;
private Log log=LogFactory.getLog(SampleRegOne.class);
private SampleRegService sampleReg=new SampleRegServiceImpl();
 private MapString,String sampledrawnBy=new HashMapString,String();
private PDDto primaryDetails=new PDDto();
 @Override
public String execute() {
try{
sampledrawnBy.put(zedlabs, Zedlabs);
sampleReg.savePrimaryDetails(primaryDetails);
 }catch(Exception e){
log.error(e.getMessage(), e);
}
return SUCCESS;
}

public MapString, String getSampledrawnBy() {
return sampledrawnBy;
}

public void setSampledrawnBy(MapString, String sampledrawnBy) {
this.sampledrawnBy = sampledrawnBy;
}

public PDDto getPrimaryDetails() {
return primaryDetails;
}

public void setPrimaryDetails(PDDto primaryDetails) {
this.primaryDetails = primaryDetails;
}


}


*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 if the validation works then i can think about messages

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 I have changed the theme to css_xhtml   so it should display right?

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:28 PM, Dave Newton davelnew...@gmail.com
 wrote:

 Then you're doing something else wrong; never mind.

 You still won't see the messages unless you display them manually.

 On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  in my case validations are not happenening . Even though validation
 fails
  it is moving to succeess rather than input jsp.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Please read up on the themes.
 
  Nutshell: validation happens (this is trivially provable), validation
  message display does not.
 
  On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
  yaragallamur...@gmail.com wrote:
   is it because of the simple theam? In simple theam validations dont
  happen
   is it? if i dont use simple theme view components are generating
 their
  own
   decoration. Our custom alignment is going wrong.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 5:05 PM, Dave Newton davelnew...@gmail.com
 
  wrote:
  
   Simple theme is simpler than you think.
   On Dec 25, 2014 4:46 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com
   
   wrote:
  
I am using struts2.3.20 and using simple theme.
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
On Thu, Dec 25, 2014 at 4:08 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:
   
 Hi i am having problem in turning on validations. I have
 written
 actionClass-validation.xml file in the same package as action
  class.
but
 the validations are not working. the following is my
 validation xml
   file.

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
   1.0.3//EN
 
 http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;
 validators

 field name=primaryDetails.branchId
  field-validator type=required
message key=error.additional.details.passport.no
 Could
  not
find
 error.additional.details.passport.no!/message
  /field-validator
  field-validator type=regex
   param name=regex![CDATA[[1-9]{0,40}]]/param
message key=error.additional.details.pancard.noCould
 not
   find
 error.additional.details.pancard.no/message
  /field-validator
 /field
  field name=primaryDetails.patientName
  field-validator type=required
message key=error.additional.details.passport.no
 Could
  not
find
 error.additional.details.passport.no!/message
  /field-validator

 /field

 /validators

 do i have to do something else to turn on validations?


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ 

Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
my struts config.xml is as below.kindly help me in solving this.

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.3//EN
http://struts.apache.org/dtds/struts-2.3.dtd;

struts

constant name=struts.enable.DynamicMethodInvocation value=false /
constant name=struts.devMode value=true /



package name=sr namespace=/ extends=struts-default

 interceptors
interceptor-stack name=appDefault
  interceptor-ref name=defaultStack /
/interceptor-stack
/interceptors

default-interceptor-ref name=appDefault /

global-results
result name=error/error.jsp/result
/global-results

global-exception-mappings
exception-mapping exception=java.lang.Exception
result=error/
/global-exception-mappings

  action name=start class=com.zedlabs.samplereg.action.InitialAction 
result name=success /sampleReg/jsp/sampleRegTemplate.jsp/result

  /action

  action name=sampleRegOne
class=com.zedlabs.samplereg.action.SampleRegOne 
result name=success
/sampleReg/jsp/sampleRegTwoTemplate.jsp/result
result name=input /sampleReg/jsp/sampleRegTemplate.jsp/result
  /action
  action name=sampleRegTwo
class=com.zedlabs.samplereg.action.SampleRegTwoAction 
result name=success
/sampleReg/jsp/sampleRegThreeTemplate.jsp/result
  /action
  action name=sampleRegThree
class=com.zedlabs.samplereg.action.SampleRegThreeAction 
result name=success
/sampleReg/jsp/sampleRegFourTemplate.jsp/result
  /action

/package

include file=mailreader-default.xml/

/struts


*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 7:47 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 The following is my action class

 package com.zedlabs.samplereg.action;

 import java.util.HashMap;
 import java.util.Map;

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

 import com.zedlabs.action.ZedActionSupport;
 import com.zedlabs.samplereg.dto.PDDto;
 import com.zedlabs.samplereg.service.SampleRegService;
 import com.zedlabs.samplereg.service.SampleRegServiceImpl;

 public class SampleRegOne extends ZedActionSupport {

 private static final long serialVersionUID = -8621676046564513353L;
 private Log log=LogFactory.getLog(SampleRegOne.class);
 private SampleRegService sampleReg=new SampleRegServiceImpl();
  private MapString,String sampledrawnBy=new HashMapString,String();
 private PDDto primaryDetails=new PDDto();
  @Override
 public String execute() {
 try{
 sampledrawnBy.put(zedlabs, Zedlabs);
 sampleReg.savePrimaryDetails(primaryDetails);
  }catch(Exception e){
 log.error(e.getMessage(), e);
 }
 return SUCCESS;
 }

 public MapString, String getSampledrawnBy() {
 return sampledrawnBy;
 }

 public void setSampledrawnBy(MapString, String sampledrawnBy) {
 this.sampledrawnBy = sampledrawnBy;
 }

 public PDDto getPrimaryDetails() {
 return primaryDetails;
 }

 public void setPrimaryDetails(PDDto primaryDetails) {
 this.primaryDetails = primaryDetails;
 }


 }


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 if the validation works then i can think about messages

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 I have changed the theme to css_xhtml   so it should display right?

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:28 PM, Dave Newton davelnew...@gmail.com
 wrote:

 Then you're doing something else wrong; never mind.

 You still won't see the messages unless you display them manually.

 On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  in my case validations are not happenening . Even though validation
 fails
  it is moving to succeess rather than input jsp.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Please read up on the themes.
 
  Nutshell: validation happens (this is trivially provable), validation
  message display does not.
 
  On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
  yaragallamur...@gmail.com wrote:
   is it because of the simple theam? In simple theam validations dont
  happen
   is it? if i dont use simple theme view components are generating
 their
  own
   decoration. Our custom alignment is going wrong.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 

Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
kindly help me solve this issue

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 my struts config.xml is as below.kindly help me in solving this.

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.3//EN
 http://struts.apache.org/dtds/struts-2.3.dtd;

 struts

 constant name=struts.enable.DynamicMethodInvocation value=false /
 constant name=struts.devMode value=true /



 package name=sr namespace=/ extends=struts-default

  interceptors
 interceptor-stack name=appDefault
   interceptor-ref name=defaultStack /
 /interceptor-stack
 /interceptors

 default-interceptor-ref name=appDefault /

 global-results
 result name=error/error.jsp/result
 /global-results

 global-exception-mappings
 exception-mapping exception=java.lang.Exception
 result=error/
 /global-exception-mappings

   action name=start class=com.zedlabs.samplereg.action.InitialAction
 
 result name=success /sampleReg/jsp/sampleRegTemplate.jsp/result

   /action

   action name=sampleRegOne
 class=com.zedlabs.samplereg.action.SampleRegOne 
 result name=success
 /sampleReg/jsp/sampleRegTwoTemplate.jsp/result
 result name=input /sampleReg/jsp/sampleRegTemplate.jsp/result

   /action
   action name=sampleRegTwo
 class=com.zedlabs.samplereg.action.SampleRegTwoAction 
 result name=success
 /sampleReg/jsp/sampleRegThreeTemplate.jsp/result
   /action
   action name=sampleRegThree
 class=com.zedlabs.samplereg.action.SampleRegThreeAction 
 result name=success
 /sampleReg/jsp/sampleRegFourTemplate.jsp/result
   /action

 /package

 include file=mailreader-default.xml/

 /struts


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 7:47 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 The following is my action class

 package com.zedlabs.samplereg.action;

 import java.util.HashMap;
 import java.util.Map;

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

 import com.zedlabs.action.ZedActionSupport;
 import com.zedlabs.samplereg.dto.PDDto;
 import com.zedlabs.samplereg.service.SampleRegService;
 import com.zedlabs.samplereg.service.SampleRegServiceImpl;

 public class SampleRegOne extends ZedActionSupport {

 private static final long serialVersionUID = -8621676046564513353L;
 private Log log=LogFactory.getLog(SampleRegOne.class);
 private SampleRegService sampleReg=new SampleRegServiceImpl();
  private MapString,String sampledrawnBy=new HashMapString,String();
 private PDDto primaryDetails=new PDDto();
  @Override
 public String execute() {
 try{
 sampledrawnBy.put(zedlabs, Zedlabs);
 sampleReg.savePrimaryDetails(primaryDetails);
  }catch(Exception e){
 log.error(e.getMessage(), e);
 }
 return SUCCESS;
 }

 public MapString, String getSampledrawnBy() {
 return sampledrawnBy;
 }

 public void setSampledrawnBy(MapString, String sampledrawnBy) {
 this.sampledrawnBy = sampledrawnBy;
 }

 public PDDto getPrimaryDetails() {
 return primaryDetails;
 }

 public void setPrimaryDetails(PDDto primaryDetails) {
 this.primaryDetails = primaryDetails;
 }


 }


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 if the validation works then i can think about messages

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 I have changed the theme to css_xhtml   so it should display right?

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:28 PM, Dave Newton davelnew...@gmail.com
 wrote:

 Then you're doing something else wrong; never mind.

 You still won't see the messages unless you display them manually.

 On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  in my case validations are not happenening . Even though validation
 fails
  it is moving to succeess rather than input jsp.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 6:15 PM, Dave Newton davelnew...@gmail.com
 wrote:
 
  Please read up on the themes.
 
  Nutshell: validation happens (this is trivially provable),
 validation
  message display does not.
 
  On Thu, Dec 25, 2014 at 6:41 AM, Yaragalla Muralidhar
  yaragallamur...@gmail.com wrote:
   is it because of the simple theam? In simple theam validations
 dont
  

Re: validation problem

2014-12-25 Thread Dave Newton
Unrelated to the technical issue: bear in mind the mailing list is a
volunteer-staffed resource. Nobody is deliberately delaying a
response. We already know you need help. In the US, at least, it's a
fairly major holiday, and people are doing things besides trying to
reproduce your environment and code to help out.

With that in mind, please be patient.


On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
yaragallamur...@gmail.com wrote:
 kindly help me solve this issue

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 my struts config.xml is as below.kindly help me in solving this.

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.3//EN
 http://struts.apache.org/dtds/struts-2.3.dtd;

 struts

 constant name=struts.enable.DynamicMethodInvocation value=false /
 constant name=struts.devMode value=true /



 package name=sr namespace=/ extends=struts-default

  interceptors
 interceptor-stack name=appDefault
   interceptor-ref name=defaultStack /
 /interceptor-stack
 /interceptors

 default-interceptor-ref name=appDefault /

 global-results
 result name=error/error.jsp/result
 /global-results

 global-exception-mappings
 exception-mapping exception=java.lang.Exception
 result=error/
 /global-exception-mappings

   action name=start class=com.zedlabs.samplereg.action.InitialAction
 
 result name=success /sampleReg/jsp/sampleRegTemplate.jsp/result

   /action

   action name=sampleRegOne
 class=com.zedlabs.samplereg.action.SampleRegOne 
 result name=success
 /sampleReg/jsp/sampleRegTwoTemplate.jsp/result
 result name=input /sampleReg/jsp/sampleRegTemplate.jsp/result

   /action
   action name=sampleRegTwo
 class=com.zedlabs.samplereg.action.SampleRegTwoAction 
 result name=success
 /sampleReg/jsp/sampleRegThreeTemplate.jsp/result
   /action
   action name=sampleRegThree
 class=com.zedlabs.samplereg.action.SampleRegThreeAction 
 result name=success
 /sampleReg/jsp/sampleRegFourTemplate.jsp/result
   /action

 /package

 include file=mailreader-default.xml/

 /struts


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 7:47 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 The following is my action class

 package com.zedlabs.samplereg.action;

 import java.util.HashMap;
 import java.util.Map;

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

 import com.zedlabs.action.ZedActionSupport;
 import com.zedlabs.samplereg.dto.PDDto;
 import com.zedlabs.samplereg.service.SampleRegService;
 import com.zedlabs.samplereg.service.SampleRegServiceImpl;

 public class SampleRegOne extends ZedActionSupport {

 private static final long serialVersionUID = -8621676046564513353L;
 private Log log=LogFactory.getLog(SampleRegOne.class);
 private SampleRegService sampleReg=new SampleRegServiceImpl();
  private MapString,String sampledrawnBy=new HashMapString,String();
 private PDDto primaryDetails=new PDDto();
  @Override
 public String execute() {
 try{
 sampledrawnBy.put(zedlabs, Zedlabs);
 sampleReg.savePrimaryDetails(primaryDetails);
  }catch(Exception e){
 log.error(e.getMessage(), e);
 }
 return SUCCESS;
 }

 public MapString, String getSampledrawnBy() {
 return sampledrawnBy;
 }

 public void setSampledrawnBy(MapString, String sampledrawnBy) {
 this.sampledrawnBy = sampledrawnBy;
 }

 public PDDto getPrimaryDetails() {
 return primaryDetails;
 }

 public void setPrimaryDetails(PDDto primaryDetails) {
 this.primaryDetails = primaryDetails;
 }


 }


 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 if the validation works then i can think about messages

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:30 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 I have changed the theme to css_xhtml   so it should display right?

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 6:28 PM, Dave Newton davelnew...@gmail.com
 wrote:

 Then you're doing something else wrong; never mind.

 You still won't see the messages unless you display them manually.

 On Thu, Dec 25, 2014 at 6:56 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  in my case validations are not happenening . Even though validation
 fails
  it is moving to succeess rather than input jsp.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  

Re: validation problem

2014-12-25 Thread Sreekanth S. Nair
As Dave said, kindly show some patience.

First of validation is nothing to do with theme so just leave the theme
alone.

1) Can you try renaming the action class name from SampleRegOne to
SampleRegOneAction
and same in struts.xml

2) If you give action alias name like below,
 action name=sampleRegOne
class=com.zedlabs.samplereg.action.SampleRegOne 

as far as i understood you need to use the alias name suffixed along with
the action class name so in essence your validator xml name should be some
thing like below

SampleRegOne-sampleRegOne-validation.xml

Since i don't have much knowledge in xml based validation i recommend you
to read upon struts2 xml based validation from the below link
http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml

If the above solution is not working then try and figure out the problem by
debugging through struts2 source.

If the above solutions couldn't resolve your problem then get some debug
level log of struts2 while accessing that particular action and post it
over here.




On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton davelnew...@gmail.com wrote:

 Unrelated to the technical issue: bear in mind the mailing list is a
 volunteer-staffed resource. Nobody is deliberately delaying a
 response. We already know you need help. In the US, at least, it's a
 fairly major holiday, and people are doing things besides trying to
 reproduce your environment and code to help out.

 With that in mind, please be patient.


 On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  kindly help me solve this issue
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
  my struts config.xml is as below.kindly help me in solving this.
 
  ?xml version=1.0 encoding=UTF-8 ?
  !DOCTYPE struts PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 2.3//EN
  http://struts.apache.org/dtds/struts-2.3.dtd;
 
  struts
 
  constant name=struts.enable.DynamicMethodInvocation
 value=false /
  constant name=struts.devMode value=true /
 
 
 
  package name=sr namespace=/ extends=struts-default
 
   interceptors
  interceptor-stack name=appDefault
interceptor-ref name=defaultStack /
  /interceptor-stack
  /interceptors
 
  default-interceptor-ref name=appDefault /
 
  global-results
  result name=error/error.jsp/result
  /global-results
 
  global-exception-mappings
  exception-mapping exception=java.lang.Exception
  result=error/
  /global-exception-mappings
 
action name=start
 class=com.zedlabs.samplereg.action.InitialAction
  
  result name=success
 /sampleReg/jsp/sampleRegTemplate.jsp/result
 
/action
 
action name=sampleRegOne
  class=com.zedlabs.samplereg.action.SampleRegOne 
  result name=success
  /sampleReg/jsp/sampleRegTwoTemplate.jsp/result
  result name=input /sampleReg/jsp/sampleRegTemplate.jsp/result
 
/action
action name=sampleRegTwo
  class=com.zedlabs.samplereg.action.SampleRegTwoAction 
  result name=success
  /sampleReg/jsp/sampleRegThreeTemplate.jsp/result
/action
action name=sampleRegThree
  class=com.zedlabs.samplereg.action.SampleRegThreeAction 
  result name=success
  /sampleReg/jsp/sampleRegFourTemplate.jsp/result
/action
 
  /package
 
  include file=mailreader-default.xml/
 
  /struts
 
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 7:47 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
  The following is my action class
 
  package com.zedlabs.samplereg.action;
 
  import java.util.HashMap;
  import java.util.Map;
 
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
 
  import com.zedlabs.action.ZedActionSupport;
  import com.zedlabs.samplereg.dto.PDDto;
  import com.zedlabs.samplereg.service.SampleRegService;
  import com.zedlabs.samplereg.service.SampleRegServiceImpl;
 
  public class SampleRegOne extends ZedActionSupport {
 
  private static final long serialVersionUID = -8621676046564513353L;
  private Log log=LogFactory.getLog(SampleRegOne.class);
  private SampleRegService sampleReg=new SampleRegServiceImpl();
   private MapString,String sampledrawnBy=new HashMapString,String();
  private PDDto primaryDetails=new PDDto();
   @Override
  public String execute() {
  try{
  sampledrawnBy.put(zedlabs, Zedlabs);
  sampleReg.savePrimaryDetails(primaryDetails);
   }catch(Exception e){
  log.error(e.getMessage(), e);
  }
  return SUCCESS;
  }
 
  public MapString, String getSampledrawnBy() {
  return sampledrawnBy;
  }
 
  public void setSampledrawnBy(MapString, String sampledrawnBy) {
  this.sampledrawnBy = sampledrawnBy;
  }
 
  public 

Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
Hi sreekanth,
   I have changed the names as u suggested but it did not work. i
have read the link u posted and i did everything that the link says. i have
debugged as well. it is not throwing any error.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
sreekanth.n...@egovernments.org wrote:

 As Dave said, kindly show some patience.

 First of validation is nothing to do with theme so just leave the theme
 alone.

 1) Can you try renaming the action class name from SampleRegOne to
 SampleRegOneAction
 and same in struts.xml

 2) If you give action alias name like below,
  action name=sampleRegOne
 class=com.zedlabs.samplereg.action.SampleRegOne 

 as far as i understood you need to use the alias name suffixed along with
 the action class name so in essence your validator xml name should be some
 thing like below

 SampleRegOne-sampleRegOne-validation.xml

 Since i don't have much knowledge in xml based validation i recommend you
 to read upon struts2 xml based validation from the below link

 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml

 If the above solution is not working then try and figure out the problem by
 debugging through struts2 source.

 If the above solutions couldn't resolve your problem then get some debug
 level log of struts2 while accessing that particular action and post it
 over here.




 On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton davelnew...@gmail.com
 wrote:

  Unrelated to the technical issue: bear in mind the mailing list is a
  volunteer-staffed resource. Nobody is deliberately delaying a
  response. We already know you need help. In the US, at least, it's a
  fairly major holiday, and people are doing things besides trying to
  reproduce your environment and code to help out.
 
  With that in mind, please be patient.
 
 
  On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
  yaragallamur...@gmail.com wrote:
   kindly help me solve this issue
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
   yaragallamur...@gmail.com wrote:
  
   my struts config.xml is as below.kindly help me in solving this.
  
   ?xml version=1.0 encoding=UTF-8 ?
   !DOCTYPE struts PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration 2.3//EN
   http://struts.apache.org/dtds/struts-2.3.dtd;
  
   struts
  
   constant name=struts.enable.DynamicMethodInvocation
  value=false /
   constant name=struts.devMode value=true /
  
  
  
   package name=sr namespace=/ extends=struts-default
  
interceptors
   interceptor-stack name=appDefault
 interceptor-ref name=defaultStack /
   /interceptor-stack
   /interceptors
  
   default-interceptor-ref name=appDefault /
  
   global-results
   result name=error/error.jsp/result
   /global-results
  
   global-exception-mappings
   exception-mapping exception=java.lang.Exception
   result=error/
   /global-exception-mappings
  
 action name=start
  class=com.zedlabs.samplereg.action.InitialAction
   
   result name=success
  /sampleReg/jsp/sampleRegTemplate.jsp/result
  
 /action
  
 action name=sampleRegOne
   class=com.zedlabs.samplereg.action.SampleRegOne 
   result name=success
   /sampleReg/jsp/sampleRegTwoTemplate.jsp/result
   result name=input
 /sampleReg/jsp/sampleRegTemplate.jsp/result
  
 /action
 action name=sampleRegTwo
   class=com.zedlabs.samplereg.action.SampleRegTwoAction 
   result name=success
   /sampleReg/jsp/sampleRegThreeTemplate.jsp/result
 /action
 action name=sampleRegThree
   class=com.zedlabs.samplereg.action.SampleRegThreeAction 
   result name=success
   /sampleReg/jsp/sampleRegFourTemplate.jsp/result
 /action
  
   /package
  
   include file=mailreader-default.xml/
  
   /struts
  
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 7:47 PM, Yaragalla Muralidhar 
   yaragallamur...@gmail.com wrote:
  
   The following is my action class
  
   package com.zedlabs.samplereg.action;
  
   import java.util.HashMap;
   import java.util.Map;
  
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  
   import com.zedlabs.action.ZedActionSupport;
   import com.zedlabs.samplereg.dto.PDDto;
   import com.zedlabs.samplereg.service.SampleRegService;
   import com.zedlabs.samplereg.service.SampleRegServiceImpl;
  
   public class SampleRegOne extends ZedActionSupport {
  
   private static final long serialVersionUID = -8621676046564513353L;
   private Log log=LogFactory.getLog(SampleRegOne.class);
   private SampleRegService sampleReg=new 

Re: validation problem

2014-12-25 Thread Sreekanth S. Nair
Can you share a sample project which is not working, and just let me know
which server you are trying..?

-- 
Thanks  Regards

Sreekanth S Nair
Java Developer
---
eGovernments Foundation http://www.egovernments.org
Ph : 9980078913
---
http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
sreekanths...@gmail.com
---

On Fri, Dec 26, 2014 at 9:10 AM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 Hi sreekanth,
I have changed the names as u suggested but it did not work. i
 have read the link u posted and i did everything that the link says. i have
 debugged as well. it is not throwing any error.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
 sreekanth.n...@egovernments.org wrote:

  As Dave said, kindly show some patience.
 
  First of validation is nothing to do with theme so just leave the theme
  alone.
 
  1) Can you try renaming the action class name from SampleRegOne to
  SampleRegOneAction
  and same in struts.xml
 
  2) If you give action alias name like below,
   action name=sampleRegOne
  class=com.zedlabs.samplereg.action.SampleRegOne 
 
  as far as i understood you need to use the alias name suffixed along with
  the action class name so in essence your validator xml name should be
 some
  thing like below
 
  SampleRegOne-sampleRegOne-validation.xml
 
  Since i don't have much knowledge in xml based validation i recommend you
  to read upon struts2 xml based validation from the below link
 
 
 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml
 
  If the above solution is not working then try and figure out the problem
 by
  debugging through struts2 source.
 
  If the above solutions couldn't resolve your problem then get some debug
  level log of struts2 while accessing that particular action and post it
  over here.
 
 
 
 
  On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton davelnew...@gmail.com
  wrote:
 
   Unrelated to the technical issue: bear in mind the mailing list is a
   volunteer-staffed resource. Nobody is deliberately delaying a
   response. We already know you need help. In the US, at least, it's a
   fairly major holiday, and people are doing things besides trying to
   reproduce your environment and code to help out.
  
   With that in mind, please be patient.
  
  
   On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
   yaragallamur...@gmail.com wrote:
kindly help me solve this issue
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:
   
my struts config.xml is as below.kindly help me in solving this.
   
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.3//EN
http://struts.apache.org/dtds/struts-2.3.dtd;
   
struts
   
constant name=struts.enable.DynamicMethodInvocation
   value=false /
constant name=struts.devMode value=true /
   
   
   
package name=sr namespace=/ extends=struts-default
   
 interceptors
interceptor-stack name=appDefault
  interceptor-ref name=defaultStack /
/interceptor-stack
/interceptors
   
default-interceptor-ref name=appDefault /
   
global-results
result name=error/error.jsp/result
/global-results
   
global-exception-mappings
exception-mapping exception=java.lang.Exception
result=error/
/global-exception-mappings
   
  action name=start
   class=com.zedlabs.samplereg.action.InitialAction

result name=success
   /sampleReg/jsp/sampleRegTemplate.jsp/result
   
  /action
   
  action name=sampleRegOne
class=com.zedlabs.samplereg.action.SampleRegOne 
result name=success
/sampleReg/jsp/sampleRegTwoTemplate.jsp/result
result name=input
  /sampleReg/jsp/sampleRegTemplate.jsp/result
   
  /action
  action name=sampleRegTwo
class=com.zedlabs.samplereg.action.SampleRegTwoAction 
result name=success
/sampleReg/jsp/sampleRegThreeTemplate.jsp/result
  /action
  action name=sampleRegThree
class=com.zedlabs.samplereg.action.SampleRegThreeAction 
result name=success
/sampleReg/jsp/sampleRegFourTemplate.jsp/result
  /action
   
/package
   
include file=mailreader-default.xml/
   
/struts
   
   
*Thanks and Regards,*
Muralidhar Yaragalla.
   
*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
   
On Thu, Dec 25, 2014 at 7:47 PM, 

Re: validation problem

2014-12-25 Thread Yaragalla Muralidhar
Hi Sreekanth,
  I think i cannot send attachements to the mailing list so i have
uploaded the project to my drive and sharing the link

https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing


i am using tomcat 7.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

On Fri, Dec 26, 2014 at 9:32 AM, Sreekanth S. Nair 
sreekanth.n...@egovernments.org wrote:

 Can you share a sample project which is not working, and just let me know
 which server you are trying..?

 --
 Thanks  Regards

 Sreekanth S Nair
 Java Developer
 ---
 eGovernments Foundation http://www.egovernments.org
 Ph : 9980078913
 ---
 http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
 https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
 sreekanths...@gmail.com
 ---

 On Fri, Dec 26, 2014 at 9:10 AM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

  Hi sreekanth,
 I have changed the names as u suggested but it did not work. i
  have read the link u posted and i did everything that the link says. i
 have
  debugged as well. it is not throwing any error.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
  sreekanth.n...@egovernments.org wrote:
 
   As Dave said, kindly show some patience.
  
   First of validation is nothing to do with theme so just leave the theme
   alone.
  
   1) Can you try renaming the action class name from SampleRegOne to
   SampleRegOneAction
   and same in struts.xml
  
   2) If you give action alias name like below,
action name=sampleRegOne
   class=com.zedlabs.samplereg.action.SampleRegOne 
  
   as far as i understood you need to use the alias name suffixed along
 with
   the action class name so in essence your validator xml name should be
  some
   thing like below
  
   SampleRegOne-sampleRegOne-validation.xml
  
   Since i don't have much knowledge in xml based validation i recommend
 you
   to read upon struts2 xml based validation from the below link
  
  
 
 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml
  
   If the above solution is not working then try and figure out the
 problem
  by
   debugging through struts2 source.
  
   If the above solutions couldn't resolve your problem then get some
 debug
   level log of struts2 while accessing that particular action and post it
   over here.
  
  
  
  
   On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton davelnew...@gmail.com
   wrote:
  
Unrelated to the technical issue: bear in mind the mailing list is a
volunteer-staffed resource. Nobody is deliberately delaying a
response. We already know you need help. In the US, at least, it's a
fairly major holiday, and people are doing things besides trying to
reproduce your environment and code to help out.
   
With that in mind, please be patient.
   
   
On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
yaragallamur...@gmail.com wrote:
 kindly help me solve this issue

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 my struts config.xml is as below.kindly help me in solving this.

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.3//EN
 http://struts.apache.org/dtds/struts-2.3.dtd;

 struts

 constant name=struts.enable.DynamicMethodInvocation
value=false /
 constant name=struts.devMode value=true /



 package name=sr namespace=/ extends=struts-default

  interceptors
 interceptor-stack name=appDefault
   interceptor-ref name=defaultStack /
 /interceptor-stack
 /interceptors

 default-interceptor-ref name=appDefault /

 global-results
 result name=error/error.jsp/result
 /global-results

 global-exception-mappings
 exception-mapping exception=java.lang.Exception
 result=error/
 /global-exception-mappings

   action name=start
class=com.zedlabs.samplereg.action.InitialAction
 
 result name=success
/sampleReg/jsp/sampleRegTemplate.jsp/result

   /action

   action name=sampleRegOne
 class=com.zedlabs.samplereg.action.SampleRegOne 
 result name=success
 /sampleReg/jsp/sampleRegTwoTemplate.jsp/result
 result name=input
   /sampleReg/jsp/sampleRegTemplate.jsp/result

   /action
   action name=sampleRegTwo
 

Re: validation problem

2014-12-25 Thread Sreekanth S. Nair
Ok let me try and will get back to you...

On Fri, Dec 26, 2014 at 11:26 AM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 Hi Sreekanth,
   I think i cannot send attachements to the mailing list so i have
 uploaded the project to my drive and sharing the link


 https://drive.google.com/file/d/0B59LVhKQaKQYamZqbnc4NGtOQm8/view?usp=sharing


 i am using tomcat 7.

 *Thanks and Regards,*
 Muralidhar Yaragalla.

 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*

 On Fri, Dec 26, 2014 at 9:32 AM, Sreekanth S. Nair 
 sreekanth.n...@egovernments.org wrote:

  Can you share a sample project which is not working, and just let me know
  which server you are trying..?
 
  --
  Thanks  Regards
 
  Sreekanth S Nair
  Java Developer
  ---
  eGovernments Foundation http://www.egovernments.org
  Ph : 9980078913
  ---
  http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/
  https://github.com/sreekanthsnair   sreekanthsn...@hotmail.co.uk
  sreekanths...@gmail.com
  ---
 
  On Fri, Dec 26, 2014 at 9:10 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi sreekanth,
  I have changed the names as u suggested but it did not
 work. i
   have read the link u posted and i did everything that the link says. i
  have
   debugged as well. it is not throwing any error.
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
   On Thu, Dec 25, 2014 at 10:43 PM, Sreekanth S. Nair 
   sreekanth.n...@egovernments.org wrote:
  
As Dave said, kindly show some patience.
   
First of validation is nothing to do with theme so just leave the
 theme
alone.
   
1) Can you try renaming the action class name from SampleRegOne to
SampleRegOneAction
and same in struts.xml
   
2) If you give action alias name like below,
 action name=sampleRegOne
class=com.zedlabs.samplereg.action.SampleRegOne 
   
as far as i understood you need to use the alias name suffixed along
  with
the action class name so in essence your validator xml name should be
   some
thing like below
   
SampleRegOne-sampleRegOne-validation.xml
   
Since i don't have much knowledge in xml based validation i recommend
  you
to read upon struts2 xml based validation from the below link
   
   
  
 
 http://www.codejava.net/frameworks/struts/struts2-form-validation-basic-example-using-xml
   
If the above solution is not working then try and figure out the
  problem
   by
debugging through struts2 source.
   
If the above solutions couldn't resolve your problem then get some
  debug
level log of struts2 while accessing that particular action and post
 it
over here.
   
   
   
   
On Thu, Dec 25, 2014 at 8:34 PM, Dave Newton davelnew...@gmail.com
wrote:
   
 Unrelated to the technical issue: bear in mind the mailing list is
 a
 volunteer-staffed resource. Nobody is deliberately delaying a
 response. We already know you need help. In the US, at least, it's
 a
 fairly major holiday, and people are doing things besides trying to
 reproduce your environment and code to help out.

 With that in mind, please be patient.


 On Thu, Dec 25, 2014 at 9:01 AM, Yaragalla Muralidhar
 yaragallamur...@gmail.com wrote:
  kindly help me solve this issue
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
 
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
  On Thu, Dec 25, 2014 at 8:02 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
  my struts config.xml is as below.kindly help me in solving this.
 
  ?xml version=1.0 encoding=UTF-8 ?
  !DOCTYPE struts PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration
 2.3//EN
  http://struts.apache.org/dtds/struts-2.3.dtd;
 
  struts
 
  constant name=struts.enable.DynamicMethodInvocation
 value=false /
  constant name=struts.devMode value=true /
 
 
 
  package name=sr namespace=/ extends=struts-default
 
   interceptors
  interceptor-stack name=appDefault
interceptor-ref name=defaultStack /
  /interceptor-stack
  /interceptors
 
  default-interceptor-ref name=appDefault /
 
  global-results
  result name=error/error.jsp/result
  /global-results
 
  global-exception-mappings
  exception-mapping exception=java.lang.Exception
  result=error/
  /global-exception-mappings
 
action name=start
 class=com.zedlabs.samplereg.action.InitialAction
  
  result name=success
 /sampleReg/jsp/sampleRegTemplate.jsp/result
 
/action
 

Re: Validation with DefaultActionValidatorManager throws NullPointerExeption

2014-02-26 Thread Lukasz Lenart
2014-02-26 13:35 GMT+01:00 Thomas Hermann therm...@mtg.de:
 Hello,

 In a JUnit-Test and in a Ajax-Server I try to validate an Object with
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager (Version
 2.3.15.3).

 The MyObject-validation.xml file is provided in the same directory as the
 MyObject-Class (no action alias used).

 I instantiate the validator manually with the new operator because the
 ActionValidatorManagerFactory is no longer supported in the version
 2.3.15.3:

 --
 DefaultActionValidatorManager validator = new
 DefaultActionValidatorManager();
 validator.validate(myObject, null);
 --

 but at runtime I get a NullPointerException:

 --
 java.lang.NullPointerException
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.loadFile(DefaultActionValidatorManager.java:342)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildClassValidatorConfigs(DefaultActionValidatorManager.java:245)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildValidatorConfigs(DefaultActionValidatorManager.java:324)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildValidatorConfigs(DefaultActionValidatorManager.java:305)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildValidatorConfigs(DefaultActionValidatorManager.java:305)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.getValidators(DefaultActionValidatorManager.java:93)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.validate(DefaultActionValidatorManager.java:127)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.validate(DefaultActionValidatorManager.java:119)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.validate(DefaultActionValidatorManager.java:114)
 --

 The problem seems to be caused by the fileManager, that is set to NULL.

 Has anyone an idea how to solve the problem?
 How is the DefaultActionValidatorManager used correctly?

You must inject FileManagerFactory - manually via setter (new
DefaultFileManagerFactory()) - but as far I understand you use
DefaultActionValidatorManager outside struts, right? If in struts
action, you can use @Inject to inject proper instance.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: Validation with DefaultActionValidatorManager throws NullPointerExeption

2014-02-26 Thread Thomas Hermann

Am 26.02.2014 13:48, schrieb Lukasz Lenart:

2014-02-26 13:35 GMT+01:00 Thomas Hermann therm...@mtg.de:

Hello,

In a JUnit-Test and in a Ajax-Server I try to validate an Object with
com.opensymphony.xwork2.validator.DefaultActionValidatorManager (Version
2.3.15.3).

The MyObject-validation.xml file is provided in the same directory as the
MyObject-Class (no action alias used).

I instantiate the validator manually with the new operator because the
ActionValidatorManagerFactory is no longer supported in the version
2.3.15.3:

--
DefaultActionValidatorManager validator = new
DefaultActionValidatorManager();
validator.validate(myObject, null);
--

but at runtime I get a NullPointerException:

--
java.lang.NullPointerException
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.loadFile(DefaultActionValidatorManager.java:342)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildClassValidatorConfigs(DefaultActionValidatorManager.java:245)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildValidatorConfigs(DefaultActionValidatorManager.java:324)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildValidatorConfigs(DefaultActionValidatorManager.java:305)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.buildValidatorConfigs(DefaultActionValidatorManager.java:305)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.getValidators(DefaultActionValidatorManager.java:93)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.validate(DefaultActionValidatorManager.java:127)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.validate(DefaultActionValidatorManager.java:119)
 at
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.validate(DefaultActionValidatorManager.java:114)
--

The problem seems to be caused by the fileManager, that is set to NULL.

Has anyone an idea how to solve the problem?
How is the DefaultActionValidatorManager used correctly?

You must inject FileManagerFactory - manually via setter (new
DefaultFileManagerFactory()) - but as far I understand you use
DefaultActionValidatorManager outside struts, right? If in struts
action, you can use @Inject to inject proper instance.


Regards


Do you simply mean:

-
DefaultActionValidatorManager validator = new 
DefaultActionValidatorManager();

validator.setFileManagerFactory(new DefaultFileManagerFactory());
validator.validate(request, null);
--
?

The DefaultFileManagerFactory is not instantiated properly. I get the 
following exception now:


---
java.lang.NullPointerException
at 
com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory.lookupFileManager(DefaultFileManagerFactory.java:57)
at 
com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory.getFileManager(DefaultFileManagerFactory.java:41)
at 
com.opensymphony.xwork2.validator.DefaultActionValidatorManager.setFileManagerFactory(DefaultActionValidatorManager.java:73)

---

Isn't there an easy way to initialize the DefaultActionValidatorManager 
properly?


Thanks,
Thomas





smime.p7s
Description: S/MIME Cryptographic Signature


Re: Validation with DefaultActionValidatorManager throws NullPointerExeption

2014-02-26 Thread Lukasz Lenart
2014-02-26 16:59 GMT+01:00 Thomas Hermann therm...@mtg.de:
 Do you simply mean:

 -
 DefaultActionValidatorManager validator = new
 DefaultActionValidatorManager();
 validator.setFileManagerFactory(new DefaultFileManagerFactory());
 validator.validate(request, null);
 --
 ?

 The DefaultFileManagerFactory is not instantiated properly. I get the
 following exception now:

 ---
 java.lang.NullPointerException
 at
 com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory.lookupFileManager(DefaultFileManagerFactory.java:57)
 at
 com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory.getFileManager(DefaultFileManagerFactory.java:41)
 at
 com.opensymphony.xwork2.validator.DefaultActionValidatorManager.setFileManagerFactory(DefaultActionValidatorManager.java:73)
 ---

The last thing left: new DefaultFileManager()

 Isn't there an easy way to initialize the DefaultActionValidatorManager
 properly?

It is, use dependency injection :-) Can you describe why do you want
to create DefaultActionValidatorManager manually instead using DI?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation xmls in a Struts2 application with no Internet connection

2013-12-16 Thread Yasser Zamani
I could not re-produce it with most recent version, 2.3.16. Both DTD 
versions work correctly on an off-line Tomcat :)


I think there is a mis-version-configuration between struts and xwork 
with that non-maven old application. Sorry for the inconvenience!


Thanks!

On 12/15/2013 03:53 PM, Lukasz Lenart wrote:

Hmm... so it must be some small bug, a typo somewhere. Can you
register an issue with the stacktrace and explanation that it works
with 1.0.2?


Thanks



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



Re: validation xmls in a Struts2 application with no Internet connection

2013-12-16 Thread Lukasz Lenart
No problem! Thanks for conformation!

2013/12/16 Yasser Zamani yasser.zam...@live.com:
 I could not re-produce it with most recent version, 2.3.16. Both DTD
 versions work correctly on an off-line Tomcat :)

 I think there is a mis-version-configuration between struts and xwork with
 that non-maven old application. Sorry for the inconvenience!

 Thanks!

 On 12/15/2013 03:53 PM, Lukasz Lenart wrote:

 Hmm... so it must be some small bug, a typo somewhere. Can you
 register an issue with the stacktrace and explanation that it works
 with 1.0.2?


 Thanks


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


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



Re: validation xmls in a Struts2 application with no Internet connection

2013-12-15 Thread Lukasz Lenart
2013/12/14 Yasser Zamani yasser.zam...@live.com:
 Hi there,

 We have a Struts2 application with some validation XMLs with following
 DOCTYPE:

!DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;


 When we run this application on a server which has access to
 struts.apache.org, there is no problem. But when we run it on a server
 which has no access to struts.apache.org, Struts can not create default
 validation interceptor with following exception:

Caught Exception while registering Interceptor class
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor
- interceptor -

 jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127
 at

 com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213)
 at

 com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
 at

 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035)

I think it has nothing to do with validators' configuration -
XmlConfigurationProvider is used to parse struts.xml, so please check
if you use the correct DOCTYPE there

https://issues.apache.org/jira/browse/WW-3741


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: validation xmls in a Struts2 application with no Internet connection

2013-12-15 Thread Yasser Zamani
I reviewed Struts internally and discovered that in all places it uses 
1.0.2 instead of 1.0.3. So, I guessed if I rewrite my DOCTYPE to:


	!DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 
1.0.2//EN http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd;


it may work. I tried and yeah, it works!

(However, it's some was confusing that xwork-validator-1.0.3.dtd is 
present in xwork.jar but we cannot use it *offline* until Struts 
also use it internally)


Sorry for the inconvenience!

Thanks for your reply.

Sincerely Yours,
Yasser.

On 12/15/2013 01:44 PM, Lukasz Lenart wrote:

2013/12/14 Yasser Zamani yasser.zam...@live.com:

Hi there,

We have a Struts2 application with some validation XMLs with following
DOCTYPE:

!DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;


When we run this application on a server which has access to
struts.apache.org, there is no problem. But when we run it on a server
which has no access to struts.apache.org, Struts can not create default
validation interceptor with following exception:

Caught Exception while registering Interceptor class
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor
- interceptor -

jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127
 at

com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213)
 at

com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
 at

com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035)


I think it has nothing to do with validators' configuration -
XmlConfigurationProvider is used to parse struts.xml, so please check
if you use the correct DOCTYPE there

https://issues.apache.org/jira/browse/WW-3741


Regards



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



Re: validation xmls in a Struts2 application with no Internet connection

2013-12-15 Thread Lukasz Lenart
Hmm... so it must be some small bug, a typo somewhere. Can you
register an issue with the stacktrace and explanation that it works
with 1.0.2?


Thanks
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/12/15 Yasser Zamani yasser.zam...@live.com:
 I reviewed Struts internally and discovered that in all places it uses
 1.0.2 instead of 1.0.3. So, I guessed if I rewrite my DOCTYPE to:

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
 1.0.2//EN http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd;

 it may work. I tried and yeah, it works!

 (However, it's some was confusing that xwork-validator-1.0.3.dtd is
 present in xwork.jar but we cannot use it *offline* until Struts also
 use it internally)

 Sorry for the inconvenience!

 Thanks for your reply.

 Sincerely Yours,
 Yasser.

 On 12/15/2013 01:44 PM, Lukasz Lenart wrote:

 2013/12/14 Yasser Zamani yasser.zam...@live.com:

 Hi there,

 We have a Struts2 application with some validation XMLs with following
 DOCTYPE:

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator
 1.0.3//EN http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd;


 When we run this application on a server which has access to
 struts.apache.org, there is no problem. But when we run it on a server
 which has no access to struts.apache.org, Struts can not create default
 validation interceptor with following exception:

 Caught Exception while registering Interceptor class

 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor
 - interceptor -


 jar:file:/home/yasser/Applications/apache-tomcat-7.0.29/webapps/TAAM/WEB-INF/lib/struts2-core-2.3.1.1.jar!/struts-default.xml:148:127
  at


 com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213)
  at


 com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
  at


 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035)


 I think it has nothing to do with validators' configuration -
 XmlConfigurationProvider is used to parse struts.xml, so please check
 if you use the correct DOCTYPE there

 https://issues.apache.org/jira/browse/WW-3741


 Regards


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


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



Re: validation not happening

2013-09-19 Thread Yaragalla Muralidhar
I am not using struts tags.

*Thanks and Regards,*
Muralidhar Yaragalla.
*
*


On Thu, Sep 19, 2013 at 11:32 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 Hi I am using struts2. I have craeted xx-validation.xml in the same dir of
 action class xx.java. I am not sure why this is happening? kindly help?

 *Thanks and Regards,*
 Muralidhar Yaragalla.
 *
 *



Re: validation not happening

2013-09-19 Thread Yaragalla Muralidhar
My StudentRegistrationAction-validation.xml is as below:-

!DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.2//EN 
http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd;
validators
field name=primDet.admissionNo
 field-validator type=regex
  param name=regex![CDATA[[0-9]{3,}]]/param
 !-- messageThe value of bar2 must be in the format
![CDATA[[0-9]{3,}] where x and y are between 0 and 9/message --
   message key=error.admission.noCould not find error.admission.no
!/message
 /field-validator
/field
field name=primDet.admissionDate
 field-validator type=regex
  param name=regex![CDATA[\d{2}/\d{2}/\d{4}]]/param
   message key=error.admission.dateCould not find
error.admission.date/message
 /field-validator
/field
/validators



My jsp code is as below:-

form id=form method=post action=primaryDetails.action
input type=text class=text size=15 name=primDet.admissionNo /
input type=text class=text style=color:#DDD4E7 value=dd/mm/
onclick=displayCalendar(event,this) size=15
name=primDet.admissionDate/
/form

My student-reg.xml is as below:-

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.3//EN
http://struts.apache.org/dtds/struts-2.3.dtd;

struts

constant name=struts.enable.DynamicMethodInvocation value=false /
constant name=struts.devMode value=true /



package name=sr namespace=/ extends=struts-default

 interceptors
 interceptor name=umsInter
class=com.ymd.ums.interceptor.UMSInterceptor/
interceptor-stack name=appDefault
  interceptor-ref name=defaultStack /
 !-- interceptor-ref name=umsInter /  --
/interceptor-stack
/interceptors

default-interceptor-ref name=appDefault /

global-results
result name=error/error.jsp/result
/global-results

global-exception-mappings
exception-mapping exception=java.lang.Exception
result=error/
/global-exception-mappings

action name=primaryDetails
class=com.ymd.ums.sm.sr.action.StudentRegistrationAction method=execute
result
name=success/jsp/StudentManage/sr_personalDetails.jsp/result
result name=input /jsp/StudentManage/sr_personalDetails.jsp/result
  /action
/package

include file=mailreader-default.xml/

/struts



This is the configaration i have. the validation is not working. please
help?

*Thanks and Regards,*
Muralidhar Yaragalla.
*
*


On Thu, Sep 19, 2013 at 11:46 PM, Dave Newton davelnew...@gmail.com wrote:

 Not enough information to help, obviously.

 Dave



 On Thu, Sep 19, 2013 at 2:06 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

  I am not using struts tags.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
  *
  *
 
 
  On Thu, Sep 19, 2013 at 11:32 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi I am using struts2. I have craeted xx-validation.xml in the same dir
  of
   action class xx.java. I am not sure why this is happening? kindly help?
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
   *
   *
  
 



 --
 e: davelnew...@gmail.com
 m: 908-380-8699
 s: davelnewton_skype
 t: @dave_newton https://twitter.com/dave_newton
 b: Bucky Bits http://buckybits.blogspot.com/
 g: davelnewton https://github.com/davelnewton
 so: Dave Newton http://stackoverflow.com/users/438992/dave-newton



Re: validation not happening

2013-09-19 Thread Dave Newton
Not enough information to help, obviously.

Dave



On Thu, Sep 19, 2013 at 2:06 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 I am not using struts tags.

 *Thanks and Regards,*
 Muralidhar Yaragalla.
 *
 *


 On Thu, Sep 19, 2013 at 11:32 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

  Hi I am using struts2. I have craeted xx-validation.xml in the same dir
 of
  action class xx.java. I am not sure why this is happening? kindly help?
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
  *
  *
 




-- 
e: davelnew...@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton https://twitter.com/dave_newton
b: Bucky Bits http://buckybits.blogspot.com/
g: davelnewton https://github.com/davelnewton
so: Dave Newton http://stackoverflow.com/users/438992/dave-newton


Re: validation not happening

2013-09-19 Thread Yaragalla Muralidhar
The validation is working fine. Thank u so much. I did a little mistake and
i found it.

*Thanks and Regards,*
Muralidhar Yaragalla.
*
*


On Thu, Sep 19, 2013 at 11:56 PM, Yaragalla Muralidhar 
yaragallamur...@gmail.com wrote:

 My StudentRegistrationAction-validation.xml is as below:-

 !DOCTYPE validators PUBLIC -//Apache Struts//XWork Validator 1.0.2//EN 
 http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd;
 validators
 field name=primDet.admissionNo
  field-validator type=regex
   param name=regex![CDATA[[0-9]{3,}]]/param
  !-- messageThe value of bar2 must be in the format
 ![CDATA[[0-9]{3,}] where x and y are between 0 and 9/message --
message key=error.admission.noCould not find error.admission.no
 !/message
  /field-validator
 /field
 field name=primDet.admissionDate
  field-validator type=regex
   param name=regex![CDATA[\d{2}/\d{2}/\d{4}]]/param
message key=error.admission.dateCould not find
 error.admission.date/message
  /field-validator
 /field
 /validators



 My jsp code is as below:-

 form id=form method=post action=primaryDetails.action
 input type=text class=text size=15 name=primDet.admissionNo /
 input type=text class=text style=color:#DDD4E7 value=dd/mm/
 onclick=displayCalendar(event,this) size=15
 name=primDet.admissionDate/
 /form

 My student-reg.xml is as below:-

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 2.3//EN
 http://struts.apache.org/dtds/struts-2.3.dtd;

 struts

 constant name=struts.enable.DynamicMethodInvocation value=false /
 constant name=struts.devMode value=true /



 package name=sr namespace=/ extends=struts-default

  interceptors
  interceptor name=umsInter
 class=com.ymd.ums.interceptor.UMSInterceptor/
 interceptor-stack name=appDefault
   interceptor-ref name=defaultStack /
  !-- interceptor-ref name=umsInter /  --
 /interceptor-stack
 /interceptors

 default-interceptor-ref name=appDefault /

 global-results
 result name=error/error.jsp/result
 /global-results

 global-exception-mappings
 exception-mapping exception=java.lang.Exception
 result=error/
 /global-exception-mappings

 action name=primaryDetails
 class=com.ymd.ums.sm.sr.action.StudentRegistrationAction method=execute
 result
 name=success/jsp/StudentManage/sr_personalDetails.jsp/result
 result name=input
 /jsp/StudentManage/sr_personalDetails.jsp/result
   /action
 /package

 include file=mailreader-default.xml/

 /struts



 This is the configaration i have. the validation is not working. please
 help?

 *Thanks and Regards,*
 Muralidhar Yaragalla.
 *
 *


 On Thu, Sep 19, 2013 at 11:46 PM, Dave Newton davelnew...@gmail.comwrote:

 Not enough information to help, obviously.

 Dave



 On Thu, Sep 19, 2013 at 2:06 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

  I am not using struts tags.
 
  *Thanks and Regards,*
  Muralidhar Yaragalla.
  *
  *
 
 
  On Thu, Sep 19, 2013 at 11:32 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi I am using struts2. I have craeted xx-validation.xml in the same
 dir
  of
   action class xx.java. I am not sure why this is happening? kindly
 help?
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
   *
   *
  
 



 --
 e: davelnew...@gmail.com
 m: 908-380-8699
 s: davelnewton_skype
 t: @dave_newton https://twitter.com/dave_newton
 b: Bucky Bits http://buckybits.blogspot.com/
 g: davelnewton https://github.com/davelnewton
 so: Dave Newton http://stackoverflow.com/users/438992/dave-newton





Re: Validation stack name

2012-07-18 Thread Dave Newton
That's the package, not the stack.

(pardon brevity, typos, and top-quoting; on cell)
On Jul 18, 2012 9:20 PM, Paul Benedict pbened...@apache.org wrote:

 http://struts.apache.org/2.3.4/docs/validation.html
 says:
 The default interceptor stack, defaultStack, already has validation
 turned on.

 Is that the right stack name? I thought the default stack name was
 struts-default

 Is this an error in the doc or my misunderstanding?

 Paul

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




Re: Validation stack name

2012-07-18 Thread Łukasz Lenart
2012/7/19 Paul Benedict pbened...@apache.org:
 http://struts.apache.org/2.3.4/docs/validation.html
 says:
 The default interceptor stack, defaultStack, already has validation
 turned on.

 Is that the right stack name? I thought the default stack name was
 struts-default

 Is this an error in the doc or my misunderstanding?

Here you have the file [1], defaultStack is the default interceptor
stack and struts-default is package name as Dave mentioned.

http://struts.apache.org/2.3.4/docs/struts-defaultxml.html


Regrads
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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



Re: Validation Help

2012-06-22 Thread Paul Mefford
lukasz.lenart,

Thanks for your response.  I am using Struts 2.1.8, Java 1.6 and tomcat 7.

On Mon, Jun 18, 2012 at 12:02 AM, Łukasz Lenart 
lukasz.len...@googlemail.com wrote:

 2012/6/17 Paul Mefford paulmeff...@gmail.com:
  Can anyone give me some advice on how to fix the .xml loader so it finds
 a
  xml file using the wildcard in sturts.xml?  Or has anyone done this a
  different way with validation?

 Struts 2 version ? App Sever ?

 You can implement your own logic how to handle validation using
 ActionValidatorManager interface - there are two known implementations
 - AnnotationActionValidatorManager (used by Struts 2) and
 DefaultActionValidatorManager (used be XWork when running without
 Struts 2).

 If you want to implement your Manager, to enable it just add the line
 below to your struts.xml

 bean type=com.opensymphony.xwork2.validator.ActionValidatorManager
 name=struts.actionValidatorManager class=con.company.MyManager /

 You can also try to debug your application and see what's going on in
 AnnotationActionValidatorManager#loadFile()


 Regards
 --
 Łukasz
 mobile +48 606 323 122 http://www.lenart.org.pl/
 Warszawa JUG conference - Confitura http://confitura.pl/

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




Re: validation method is being executed twice in IE (jCaptcha img)

2012-06-19 Thread Dave Newton
How is it fetching the image? That shouldn't cause a request to the action.

Dave

(pardon brevity and typos, on cell)
On Jun 19, 2012 4:58 AM, lucas owen sr.ilus...@gmail.com wrote:

 Hi Struts 2 Users!

 I have this little problem here, only in Internet Explorer (it works in
 Firefox and Chrome):

 the action is being executed twice I think because in the JSP form I have a
 captcha with an image and when it fetches the image it creates a new
 request.

 Anybody knows how to solve it?

 thanks in advance!!



Re: validation method is being executed twice in IE (jCaptcha img)

2012-06-19 Thread Maurizio Cucchiara
Hi Lucas,

we need some more further details...
What S2 stack did you define for you action? Why do you suspect that your
action is executed twice?
Could you post the java and jsp fragments?

Twitter :http://www.twitter.com/m_cucchiara
G+  :https://plus.google.com/107903711540963855921
Linkedin:http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 19 June 2012 10:58, lucas owen sr.ilus...@gmail.com wrote:

 Hi Struts 2 Users!

 I have this little problem here, only in Internet Explorer (it works in
 Firefox and Chrome):

 the action is being executed twice I think because in the JSP form I have a
 captcha with an image and when it fetches the image it creates a new
 request.

 Anybody knows how to solve it?

 thanks in advance!!



Re: Validation Help

2012-06-18 Thread Łukasz Lenart
2012/6/17 Paul Mefford paulmeff...@gmail.com:
 Can anyone give me some advice on how to fix the .xml loader so it finds a
 xml file using the wildcard in sturts.xml?  Or has anyone done this a
 different way with validation?

Struts 2 version ? App Sever ?

You can implement your own logic how to handle validation using
ActionValidatorManager interface - there are two known implementations
- AnnotationActionValidatorManager (used by Struts 2) and
DefaultActionValidatorManager (used be XWork when running without
Struts 2).

If you want to implement your Manager, to enable it just add the line
below to your struts.xml

bean type=com.opensymphony.xwork2.validator.ActionValidatorManager
name=struts.actionValidatorManager class=con.company.MyManager /

You can also try to debug your application and see what's going on in
AnnotationActionValidatorManager#loadFile()


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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



Re: Validation doesn’t honor the bundle attribute in http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd

2012-03-01 Thread Jeffrey Black
Hi Joann,

Can you please confirm what version of Struts you are using?

You appear to be using Struts 2 for your application [1]; however it
appears you are referencing Struts 1.x validation information.  Perhaps I'm
missing something?

[1]
http://struts.1045723.n5.nabble.com/How-to-implement-alternate-error-messages-in-the-Struts-validation-framework-Struts-2-0-1-4-td5522076.html

Best,

jb

On Thu, Mar 1, 2012 at 8:59 AM, joann luo joannlu...@gmail.com wrote:

 Hello,
 I am using http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd but
 I
 found it still does not honor ‘bundle” attribute in the validation.xml.

 I need to display an alternate error message defined in a custom
 bundle through the Struts validation framework instead of the default
 error message.  Based on the information provided from this early
 thread, it should have been available since Validator 1.1.4.

 http://www.mail-archive.com/user@struts.apache.org/msg23694.html
 If this is still not supported in validator_1_3_0.dtd, then is there any
 way to implement this?




 I appreciate any advice you may have.



 Thank you.



Re: Validation doesn’t honor the bundle attribute in http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd

2012-03-01 Thread joann luo
Hello,

I am sorry about the confusion before.

I searched web app's component.xml file and found the following, therefore,
we are actually using Struts1.2.4 in this project.

dependency name=prereqs.sn/struts.minimal type=jar version=1.2.4 /
dependency name=prereqs.sn/struts.extra type=jar version=1.2.4 /

Per my previous email, even though I updated the validation.xml and
validator-rules.xml to point to validator_1_3_0.dtd, the bundle attribute
still does not work.

Is there any other way to provide customized error message for
errors.required, errors.invalid cases instead of using the out-of-box
ones?

Thanks a lot
Joann

On Thu, Mar 1, 2012 at 12:04 PM, Jeffrey Black jeffblack...@gmail.comwrote:

 Hi Joann,

 Can you please confirm what version of Struts you are using?

 You appear to be using Struts 2 for your application [1]; however it
 appears you are referencing Struts 1.x validation information.  Perhaps I'm
 missing something?

 [1]

 http://struts.1045723.n5.nabble.com/How-to-implement-alternate-error-messages-in-the-Struts-validation-framework-Struts-2-0-1-4-td5522076.html

 Best,

 jb

 On Thu, Mar 1, 2012 at 8:59 AM, joann luo joannlu...@gmail.com wrote:

  Hello,
  I am using http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtdbut
  I
  found it still does not honor ‘bundle” attribute in the validation.xml.
 
  I need to display an alternate error message defined in a custom
  bundle through the Struts validation framework instead of the default
  error message.  Based on the information provided from this early
  thread, it should have been available since Validator 1.1.4.
 
  http://www.mail-archive.com/user@struts.apache.org/msg23694.html
  If this is still not supported in validator_1_3_0.dtd, then is there any
  way to implement this?
 
 
 
 
  I appreciate any advice you may have.
 
 
 
  Thank you.
 



Re: Validation doesn’t honor the bundle attribute in http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd

2012-03-01 Thread Dave Newton
You can't just update a validation DTD and expect everything to suddenly
use a later version of the validation libraries. S1.2.4, AFAIK, uses
validator 1.1.3. Hence all S1.2.4 code will be written assuming
commons-validator 1.1.3.

Capabilities introduced in later versions of commons-validator would
require deploying said later version. Any S1 interactions with
commons-validator, however, would remain at the 1.1.3 level. If it's a
validator-only issue, it *may* still work, but if the new functionality
relies on any S1 interaction, I'm pretty sure it wouldn't.

Dave

On Thu, Mar 1, 2012 at 3:33 PM, joann luo joannlu...@gmail.com wrote:

 Hello,

 I am sorry about the confusion before.

 I searched web app's component.xml file and found the following, therefore,
 we are actually using Struts1.2.4 in this project.

 dependency name=prereqs.sn/struts.minimal type=jar version=1.2.4 /
 dependency name=prereqs.sn/struts.extra type=jar version=1.2.4 /

 Per my previous email, even though I updated the validation.xml and
 validator-rules.xml to point to validator_1_3_0.dtd, the bundle attribute
 still does not work.

 Is there any other way to provide customized error message for
 errors.required, errors.invalid cases instead of using the out-of-box
 ones?

 Thanks a lot
 Joann

 On Thu, Mar 1, 2012 at 12:04 PM, Jeffrey Black jeffblack...@gmail.com
 wrote:

  Hi Joann,
 
  Can you please confirm what version of Struts you are using?
 
  You appear to be using Struts 2 for your application [1]; however it
  appears you are referencing Struts 1.x validation information.  Perhaps
 I'm
  missing something?
 
  [1]
 
 
 http://struts.1045723.n5.nabble.com/How-to-implement-alternate-error-messages-in-the-Struts-validation-framework-Struts-2-0-1-4-td5522076.html
 
  Best,
 
  jb
 
  On Thu, Mar 1, 2012 at 8:59 AM, joann luo joannlu...@gmail.com wrote:
 
   Hello,
   I am using
 http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtdbut
   I
   found it still does not honor ‘bundle” attribute in the validation.xml.
  
   I need to display an alternate error message defined in a custom
   bundle through the Struts validation framework instead of the default
   error message.  Based on the information provided from this early
   thread, it should have been available since Validator 1.1.4.
  
   http://www.mail-archive.com/user@struts.apache.org/msg23694.html
   If this is still not supported in validator_1_3_0.dtd, then is there
 any
   way to implement this?
  
  
  
  
   I appreciate any advice you may have.
  
  
  
   Thank you.
  
 



Re: Validation doesn’t honor the bundle attribute in http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd

2012-03-01 Thread joann luo
Hello, Dave:

Thanks for pointing this out.

I am working on a customer issue reported from a project that we released
quite a while ago. I won't be able to upgrade the struts JAR in this case.

Since I have to stay with validator 1.1.3 is there any other way to provide
customized error message for errors.required, errors.invalid cases
instead of using the out-of-box
ones?

Thanks again,
Joann

On Thu, Mar 1, 2012 at 3:41 PM, Dave Newton davelnew...@gmail.com wrote:

 You can't just update a validation DTD and expect everything to suddenly
 use a later version of the validation libraries. S1.2.4, AFAIK, uses
 validator 1.1.3. Hence all S1.2.4 code will be written assuming
 commons-validator 1.1.3.

 Capabilities introduced in later versions of commons-validator would
 require deploying said later version. Any S1 interactions with
 commons-validator, however, would remain at the 1.1.3 level. If it's a
 validator-only issue, it *may* still work, but if the new functionality
 relies on any S1 interaction, I'm pretty sure it wouldn't.

 Dave

 On Thu, Mar 1, 2012 at 3:33 PM, joann luo joannlu...@gmail.com wrote:

  Hello,
 
  I am sorry about the confusion before.
 
  I searched web app's component.xml file and found the following,
 therefore,
  we are actually using Struts1.2.4 in this project.
 
  dependency name=prereqs.sn/struts.minimal type=jar version=1.2.4
 /
  dependency name=prereqs.sn/struts.extra type=jar version=1.2.4 /
 
  Per my previous email, even though I updated the validation.xml and
  validator-rules.xml to point to validator_1_3_0.dtd, the bundle attribute
  still does not work.
 
  Is there any other way to provide customized error message for
  errors.required, errors.invalid cases instead of using the out-of-box
  ones?
 
  Thanks a lot
  Joann
 
  On Thu, Mar 1, 2012 at 12:04 PM, Jeffrey Black jeffblack...@gmail.com
  wrote:
 
   Hi Joann,
  
   Can you please confirm what version of Struts you are using?
  
   You appear to be using Struts 2 for your application [1]; however it
   appears you are referencing Struts 1.x validation information.  Perhaps
  I'm
   missing something?
  
   [1]
  
  
 
 http://struts.1045723.n5.nabble.com/How-to-implement-alternate-error-messages-in-the-Struts-validation-framework-Struts-2-0-1-4-td5522076.html
  
   Best,
  
   jb
  
   On Thu, Mar 1, 2012 at 8:59 AM, joann luo joannlu...@gmail.com
 wrote:
  
Hello,
I am using
  http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtdbut
I
found it still does not honor ‘bundle” attribute in the
 validation.xml.
   
I need to display an alternate error message defined in a custom
bundle through the Struts validation framework instead of the default
error message.  Based on the information provided from this early
thread, it should have been available since Validator 1.1.4.
   
http://www.mail-archive.com/user@struts.apache.org/msg23694.html
If this is still not supported in validator_1_3_0.dtd, then is there
  any
way to implement this?
   
   
   
   
I appreciate any advice you may have.
   
   
   
Thank you.
   
  
 



Re: Validation doesn’t honor the bundle attribute in http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd

2012-03-01 Thread Dave Newton
http://struts.apache.org/1.2.4/userGuide/dev_validator.html#i18n

On Thu, Mar 1, 2012 at 4:02 PM, joann luo joannlu...@gmail.com wrote:

 Hello, Dave:

 Thanks for pointing this out.

 I am working on a customer issue reported from a project that we released
 quite a while ago. I won't be able to upgrade the struts JAR in this case.

 Since I have to stay with validator 1.1.3 is there any other way to provide
 customized error message for errors.required, errors.invalid cases
 instead of using the out-of-box
 ones?

 Thanks again,
 Joann

 On Thu, Mar 1, 2012 at 3:41 PM, Dave Newton davelnew...@gmail.com wrote:

  You can't just update a validation DTD and expect everything to suddenly
  use a later version of the validation libraries. S1.2.4, AFAIK, uses
  validator 1.1.3. Hence all S1.2.4 code will be written assuming
  commons-validator 1.1.3.
 
  Capabilities introduced in later versions of commons-validator would
  require deploying said later version. Any S1 interactions with
  commons-validator, however, would remain at the 1.1.3 level. If it's a
  validator-only issue, it *may* still work, but if the new functionality
  relies on any S1 interaction, I'm pretty sure it wouldn't.
 
  Dave
 
  On Thu, Mar 1, 2012 at 3:33 PM, joann luo joannlu...@gmail.com wrote:
 
   Hello,
  
   I am sorry about the confusion before.
  
   I searched web app's component.xml file and found the following,
  therefore,
   we are actually using Struts1.2.4 in this project.
  
   dependency name=prereqs.sn/struts.minimal type=jar
 version=1.2.4
  /
   dependency name=prereqs.sn/struts.extra type=jar version=1.2.4
 /
  
   Per my previous email, even though I updated the validation.xml and
   validator-rules.xml to point to validator_1_3_0.dtd, the bundle
 attribute
   still does not work.
  
   Is there any other way to provide customized error message for
   errors.required, errors.invalid cases instead of using the
 out-of-box
   ones?
  
   Thanks a lot
   Joann
  
   On Thu, Mar 1, 2012 at 12:04 PM, Jeffrey Black jeffblack...@gmail.com
   wrote:
  
Hi Joann,
   
Can you please confirm what version of Struts you are using?
   
You appear to be using Struts 2 for your application [1]; however it
appears you are referencing Struts 1.x validation information.
  Perhaps
   I'm
missing something?
   
[1]
   
   
  
 
 http://struts.1045723.n5.nabble.com/How-to-implement-alternate-error-messages-in-the-Struts-validation-framework-Struts-2-0-1-4-td5522076.html
   
Best,
   
jb
   
On Thu, Mar 1, 2012 at 8:59 AM, joann luo joannlu...@gmail.com
  wrote:
   
 Hello,
 I am using
   http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtdbut
 I
 found it still does not honor ‘bundle” attribute in the
  validation.xml.

 I need to display an alternate error message defined in a custom
 bundle through the Struts validation framework instead of the
 default
 error message.  Based on the information provided from this early
 thread, it should have been available since Validator 1.1.4.

 http://www.mail-archive.com/user@struts.apache.org/msg23694.html
 If this is still not supported in validator_1_3_0.dtd, then is
 there
   any
 way to implement this?




 I appreciate any advice you may have.



 Thank you.

   
  
 



Re: Validation FieldErrors missing after Struts2 Update (2.1.8 to 2.3.1.2)

2012-02-10 Thread Maurizio Cucchiara
Hi Jorg,
according to the docs [1] you should use
struts.xwork.chaining.copyFieldErrors - set to true to copy Field Errors

[1]
http://struts.apache.org/2.3.1.2/xwork-core/apidocs/com/opensymphony/xwork2/interceptor/ChainingInterceptor.html

Twitter :http://www.twitter.com/m_cucchiara
G+  :https://plus.google.com/107903711540963855921
Linkedin:http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 10 February 2012 17:33, Jörg Bostelmann joerg.bostelm...@hmmh.de wrote:

 ShowProduct


Re: Validation FieldErrors missing after Struts2 Update (2.1.8 to 2.3.1.2)

2012-02-10 Thread Jörg Bostelmann
Hi Maurizio,

thanks for your quick answer. This solved my problem. Field errors are shown :-)
Thank you again, you saved my weekend :-)

Wish you a nice weekend,
Jörg

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



Re: Validation FieldErrors missing after Struts2 Update (2.1.8 to 2.3.1.2)

2012-02-10 Thread Maurizio Cucchiara
I am glad it worked out.

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 10 February 2012 18:03, Jörg Bostelmann joerg.bostelm...@hmmh.de wrote:

 Hi Maurizio,

 thanks for your quick answer. This solved my problem. Field errors are shown 
 :-)
 Thank you again, you saved my weekend :-)

 Wish you a nice weekend,
 Jörg

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


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



Re: Validation in Struts 1

2010-10-25 Thread Dave Newton
That's not combining client- and server-side validation, that's
combining declarative and programmatic validation, unless you're
talking about the JavaScript validation method.

Dave

On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepati anji...@hotmail.com wrote:
 Hi

 Can we combine client side validation and server side validation? i.e. using
 validation.xml as well as validation in  validate() method as well.
 Does it make any sense?

 Thanks


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



Re: Validation in Struts 1

2010-10-25 Thread Anjib Mulepati
ok so is this mean both is server side validation and client side 
validation is done with Javascript?


Also between these two(.xml and execute() method) which one is better? 
Any pros and cons?


Anjib

On 10/25/2010 1:55 PM, Dave Newton wrote:

That's not combining client- and server-side validation, that's
combining declarative and programmatic validation, unless you're
talking about the JavaScript validation method.

Dave

On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepatianji...@hotmail.com  wrote:

Hi

Can we combine client side validation and server side validation? i.e. using
validation.xml as well as validation in  validate() method as well.
Does it make any sense?

Thanks


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






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



Re: Validation in Struts 1

2010-10-25 Thread Dave Newton
On Mon, Oct 25, 2010 at 2:01 PM, Anjib Mulepati anji...@hotmail.com wrote:
 ok so is this mean both is server side validation and client side validation 
 is done with Javascript?

???

No. Client-side validation is done with JavaScript, because that's
what runs inside browsers. Server-side validation is done in Java,
whether or not it's driven by XML.

 Also between these two(.xml and execute() method) which one is better? Any
 pros and cons?

execute() method? Do you mean the validate() method? Neither is
better--they're different things. XML/declarative validation is more
useful for simple validations: length, masks, etc. The validate()
method is more useful for business-logic-oriented validation, like if
a business has a flag set then we only allow US addresses or
something along those lines.

The two are combinable; use XML for easy stuff, validate() for hard stuff.

Dave

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



Re: Validation in Struts 1

2010-10-25 Thread Qiang Li
On Mon, 2010-10-25 at 14:01 -0400, Anjib Mulepati wrote:
 ok so is this mean both is server side validation and client side 
 validation is done with Javascript?
 
 Also between these two(.xml and execute() method) which one is better? 
 Any pros and cons?
 
 Anjib
 
 On 10/25/2010 1:55 PM, Dave Newton wrote:
  That's not combining client- and server-side validation, that's
  combining declarative and programmatic validation, unless you're
  talking about the JavaScript validation method.
 
  Dave
 
  On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepatianji...@hotmail.com  wrote:
  Hi
 
  Can we combine client side validation and server side validation? i.e. 
  using
  validation.xml as well as validation in  validate() method as well.
  Does it make any sense?
 
  Thanks
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 

Client side validation via javascripts prevents client to server
communication if some error can be deal with at client side, ie, input
eroor, which reduces server burden. However, server side validation is
also needed because clients can walk around client side intentionally.

Please correct me if I said something wrong.

Qiang

-- 
Qiang Li
HuBei Polytechnic Institute
No. 17 YuQuan Road
XiaoGan HuBei 432100
China
E-mail:  liqi...@hbvtc.edu.cn


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



Re: Validation Problem

2010-10-09 Thread Maurizio Cucchiara
It's a know bug.
If your application doesn't run in a production environment  you could
download latest struts release from
https://hudson.apache.org/hudson/view/Struts/job/struts2/

Maurizio Cucchiara

2010/10/9 Chris Miles ch...@chrismiles.org:
 Whenever the validation procedure returns to the input result, any
 s:action elements are not executed. Is there a reason for this? Is there
 anything which needs to be configured or toggled to allow it?



 Thanks



 Chris



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



Re: Validation with preloading form fields

2010-10-08 Thread Dave Newton
Are you implementing Preparable, or overriding the input() method?

Dave

On Friday, October 8, 2010, Joshua Tennent tenne...@gmail.com wrote:
  I am having trouble validating a form where it requires preloading lists for 
 some of the fields. I'm not sure how to configure the struts.xml entry for 
 the INPUT return type.

 I am getting this error, which is indicating it's not getting to the prepare 
 method of createCharacterAction:
 tag 'radio', field 'list', name 'gender': The requested list key 'genders' 
 could not be resolved as a collection/array/map/enumeration/iterator type. 
 Example: people or people.{name} - [unknown location]

 The form will load properly when I call the action directly or from my 
 redirectAction below in the doLogin action. I have tried various values for 
 the input type but nothing seems to work. Any suggestions?

 action name=doLogin class=loginAction
 result name=input type=tiles/login/result
 result name=error type=tiles/login/result
 result name=success type=tiles/welcome/result
 result name=nocharacter 
 type=redirectActionprepareCreateCharacter/result
 /action

 action name=*CreateCharacter method={1} class=createCharacterAction
 result name=prepare/pages/createcharacter.jsp/result
 result name=input/pages/createcharacter.jsp/result
 result name=error/pages/createcharacter.jsp/result
 result name=success type=tiles/welcome/result
 /action


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



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



Re: Validation with preloading form fields

2010-10-08 Thread Joshua Tennent

 That was it, thanks! I forgot to implement Preparable.

On 10/8/2010 7:45 PM, Dave Newton wrote:

Are you implementing Preparable, or overriding the input() method?

Dave

On Friday, October 8, 2010, Joshua Tennenttenne...@gmail.com  wrote:

  I am having trouble validating a form where it requires preloading lists for 
some of the fields. I'm not sure how to configure the struts.xml entry for the 
INPUT return type.

I am getting this error, which is indicating it's not getting to the prepare 
method of createCharacterAction:
tag 'radio', field 'list', name 'gender': The requested list key 'genders' 
could not be resolved as a collection/array/map/enumeration/iterator type. 
Example: people or people.{name} - [unknown location]

The form will load properly when I call the action directly or from my 
redirectAction below in the doLogin action. I have tried various values for the 
input type but nothing seems to work. Any suggestions?

action name=doLogin class=loginAction
result name=input type=tiles/login/result
result name=error type=tiles/login/result
result name=success type=tiles/welcome/result
result name=nocharacter type=redirectActionprepareCreateCharacter/result
/action

action name=*CreateCharacter method={1} class=createCharacterAction
result name=prepare/pages/createcharacter.jsp/result
result name=input/pages/createcharacter.jsp/result
result name=error/pages/createcharacter.jsp/result
result name=success type=tiles/welcome/result
/action


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



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





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



Re: Validation with preloading form fields

2010-10-08 Thread Dave Newton
No sweat :)

On Friday, October 8, 2010, Joshua Tennent tenne...@gmail.com wrote:
  That was it, thanks! I forgot to implement Preparable.

 On 10/8/2010 7:45 PM, Dave Newton wrote:

 Are you implementing Preparable, or overriding the input() method?

 Dave

 On Friday, October 8, 2010, Joshua Tennenttenne...@gmail.com  wrote:

   I am having trouble validating a form where it requires preloading lists 
 for some of the fields. I'm not sure how to configure the struts.xml entry 
 for the INPUT return type.

 I am getting this error, which is indicating it's not getting to the prepare 
 method of createCharacterAction:
 tag 'radio', field 'list', name 'gender': The requested list key 'genders' 
 could not be resolved as a collection/array/map/enumeration/iterator type. 
 Example: people or people.{name} - [unknown location]

 The form will load properly when I call the action directly or from my 
 redirectAction below in the doLogin action. I have tried various values for 
 the input type but nothing seems to work. Any suggestions?

 action name=doLogin class=loginAction
 result name=input type=tiles/login/result
 result name=error type=tiles/login/result
 result name=success type=tiles/welcome/result
 result name=nocharacter 
 type=redirectActionprepareCreateCharacter/result
 /action

 action name=*CreateCharacter method={1} class=createCharacterAction
 result name=prepare/pages/createcharacter.jsp/result
 result name=input/pages/createcharacter.jsp/result
 result name=error/pages/createcharacter.jsp/result
 result name=success type=tiles/welcome/result
 /action


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



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





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



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



Re: validation and form display problem

2010-07-11 Thread Burton Rhodes
That sounds like a classic 'prepare' problem.  Take a look at the
documentation on implementing Preparable in your action. You will want
to initialize your backing beans inside the Prepare method in your
action. That when 'input' is needed, your backing beans will be
loaded.

On 7/10/10, Jake Vang vangj...@googlemail.com wrote:
 i have a form that i display. but to display that form, i have to
 fetch some data from the database and then place that data on the
 valuestack (via backing beans). when the form is displayed, it expects
 that those backing beans should be populated. the form then posts to a
 save action.

 i have a className-alias-validation.xml that validates the form
 values. i have specified that if the result is input then go back to
 the form. the problem is that when the result is input and the
 form/page is reloaded, the beans are no longer populated and the form
 displays as blank.

 is there a way to intercept or is there a hook that i can grab to have
 an opportunity to populate my backing beans?

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



-- 
Sent from my mobile device

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



Re: validation and form display problem

2010-07-11 Thread Jake Vang
what i did was to override ValidationAware.hasErrors(). according to
the docs, the workflow interceptor calls this method, if there are
validation errors, it returns input and stops further execution of
the action. i tried this...

public boolean hasErrors() {
 boolean result = super.hasErrors();
 if(result) {
  //fetch data here
 }
 return result;
}

On Sun, Jul 11, 2010 at 7:23 AM, Burton Rhodes burtonrho...@gmail.com wrote:
 That sounds like a classic 'prepare' problem.  Take a look at the
 documentation on implementing Preparable in your action. You will want
 to initialize your backing beans inside the Prepare method in your
 action. That when 'input' is needed, your backing beans will be
 loaded.

 On 7/10/10, Jake Vang vangj...@googlemail.com wrote:
 i have a form that i display. but to display that form, i have to
 fetch some data from the database and then place that data on the
 valuestack (via backing beans). when the form is displayed, it expects
 that those backing beans should be populated. the form then posts to a
 save action.

 i have a className-alias-validation.xml that validates the form
 values. i have specified that if the result is input then go back to
 the form. the problem is that when the result is input and the
 form/page is reloaded, the beans are no longer populated and the form
 displays as blank.

 is there a way to intercept or is there a hook that i can grab to have
 an opportunity to populate my backing beans?

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



 --
 Sent from my mobile device

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



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



RE: validation and form display problem

2010-07-10 Thread Martin Gainty

you could use the org.apache.struts2.config_browser.ShowValidatorAction

then use java.beans.Introspector to acquire the bean from Validator.class

 

try 

{ 

java.beans.BeanInfo beanInfoFrom = 
java.beans.Introspector.getBeanInfo(validator.getClass(), Object.class);

} 

catch (IntrospectionException e) 

{

LOG.error(An error occurred, e);

addActionError(An error occurred while introspecting a validator of type  + 
validator.getClass().getName());

return ERROR;

}


//make sure you get back non null validator from getSelectedValidator() accessor

public com.opensymphony.xwork2.validator.Validator

 getSelectedValidator() {

return (com.opensymphony.xwork2.validator.Validator) validators.get(selected);

}


Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
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.



 

 Date: Sat, 10 Jul 2010 18:10:32 -0400
 Subject: validation and form display problem
 From: vangj...@googlemail.com
 To: user@struts.apache.org
 
 i have a form that i display. but to display that form, i have to
 fetch some data from the database and then place that data on the
 valuestack (via backing beans). when the form is displayed, it expects
 that those backing beans should be populated. the form then posts to a
 save action.
 
 i have a className-alias-validation.xml that validates the form
 values. i have specified that if the result is input then go back to
 the form. the problem is that when the result is input and the
 form/page is reloaded, the beans are no longer populated and the form
 displays as blank.
 
 is there a way to intercept or is there a hook that i can grab to have
 an opportunity to populate my backing beans?
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

Re: Validation of indexed properties

2010-02-26 Thread hugh111111

Hi Cielpa,

'Invalid property' would suggest that your form does not contain the
property searchList. It is difficult to tell without a bit of background and
seeing some code. Can you explain what you are doing and show me your
struts-config.xml file.

By the way, your form should be declared as a DynaValidatorForm. There is no
such thing as a DynaValidatorActionForm. 

For example..

form-bean name=myForm type=org.apache.struts.action.DynaValidatorForm
form-property name=searchList type=java.util.ArrayList/ 
/form-bean



Hugh




Cielpa wrote:
 
 Hey,
 
 I have a similar problem with DynaValidatorActionForm.
 It says that invalid property when i have a ArrayList in the
 form-property name=searchList type=java.util.ArrayList/ in the
 form-bean declaration.
 
 Any idea?
  Thanks and your help is appreciated.
 Silpa
 
 hugh11 wrote:
 
 I've got a problem relating to the validation of indexed properties in
 Struts 1.1
 I get the following error message when I try to access an ArrayList of
 students in my DynaValidatorForm
 
 root cause 
 
 java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
 java.util.ArrayList.RangeCheck(Unknown Source)
 java.util.ArrayList.get(Unknown Source)
 org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:298)
 
 
 
 Here is some background to the problem...
 
 In my session I have an ArrayList called studentsList of objects of type
 experiment.mybeans.Student. A Student object has getter and setter
 methods for id, year and gradeAverage.
 
 In my students.jsp I create a table by iterating through my student
 objects like this...
 
 c:forEach var=students items=${sessionScope.group.studentsList} 
   trtdhtml:text indexed=true name=students property=id//td
   tdhtml:text indexed=true name=students property=year//td
   tdhtml:text indexed=true name=students
 property=gradeAverage//td/tr
 /c:forEach
 
 As you can see the table contains empty text boxes and I would like to
 validate these have been filled in, so in struts-config.xml I create my
 dynavalidatorform as follows...
 
 form-bean name=studentsForm
 type=org.apache.struts.validator.DynaValidatorForm 
 form-property name=students type=java.util.ArrayList /
 /form-bean
 
 And in validation.xml I place my validation rules...
 
 form name=studentsForm 
field property=id indexedListProperty=students
 depends=required
  arg0 key=error.studentid.required/
 /field
field property=year indexedListProperty=students
 depends=required
  arg0 key=error.studentyear.required/
 /field
field  property=gradeAverage indexedListProperty=students
 depends=required
  arg0 key=error.studentgrade.required/
 /field
 /form
 
 Now here is where things start to go a bit pear-shaped
 
 I have read somewhere online that I need to populate the form ArrayList
 before I get to my jsp page. So I have created an action class called
 PreStudentsAction.java which takes the student ArrayList out of the
 session and assigns it to the student ArrayList in the form before
 forwarding to the students.jsp page...
 
 public class PreStudentsAction extends Action{
  
  public ActionForward execute(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws Exception
  {
  
  DynaValidatorForm myForm = (DynaValidatorForm)form;
  Group group = (Group)request.getSession().getAttribute(group);
  ArrayListStudent students = group.getStudentsList();
  
  myForm.set(students, students);   
  return (mapping.findForward(success));
  }
 
 }
 
 
 Finally when I run my application my table is displayed but when I fill
 in the table and press submit I get the IndexOutOfBounds error. It
 appears to me that the student ArrayList in the form remains empty and
 that my Action class was unsuccessful in populating the form's ArrayList.
 
 Can anybody see what I'm doing wrong?
 
 
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Validation-of-indexed-properties-tp27493794p27720862.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation of indexed properties

2010-02-26 Thread hugh111111

Sorry Cielpa, my mistake. 
Turns out there is such a thing as a DynaValidatorActionForm. Shows how much
I know.

Hugh



hugh11 wrote:
 
 Hi Cielpa,
 
 'Invalid property' would suggest that your form does not contain the
 property searchList. It is difficult to tell without a bit of background
 and seeing some code. Can you explain what you are doing and show me your
 struts-config.xml file.
 
 By the way, your form should be declared as a DynaValidatorForm. There is
 no such thing as a DynaValidatorActionForm. 
 
 For example..
 
 form-bean name=myForm
 type=org.apache.struts.action.DynaValidatorForm
 form-property name=searchList type=java.util.ArrayList/ 
 /form-bean
 
 
 
 Hugh
 
 
 
 
 Cielpa wrote:
 
 Hey,
 
 I have a similar problem with DynaValidatorActionForm.
 It says that invalid property when i have a ArrayList in the
 form-property name=searchList type=java.util.ArrayList/ in the
 form-bean declaration.
 
 Any idea?
  Thanks and your help is appreciated.
 Silpa
 
 hugh11 wrote:
 
 I've got a problem relating to the validation of indexed properties in
 Struts 1.1
 I get the following error message when I try to access an ArrayList of
 students in my DynaValidatorForm
 
 root cause 
 
 java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
 java.util.ArrayList.RangeCheck(Unknown Source)
 java.util.ArrayList.get(Unknown Source)
 org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:298)
 
 
 
 Here is some background to the problem...
 
 In my session I have an ArrayList called studentsList of objects of type
 experiment.mybeans.Student. A Student object has getter and setter
 methods for id, year and gradeAverage.
 
 In my students.jsp I create a table by iterating through my student
 objects like this...
 
 c:forEach var=students items=${sessionScope.group.studentsList} 
   trtdhtml:text indexed=true name=students property=id//td
   tdhtml:text indexed=true name=students property=year//td
   tdhtml:text indexed=true name=students
 property=gradeAverage//td/tr
 /c:forEach
 
 As you can see the table contains empty text boxes and I would like to
 validate these have been filled in, so in struts-config.xml I create my
 dynavalidatorform as follows...
 
 form-bean name=studentsForm
 type=org.apache.struts.validator.DynaValidatorForm 
 form-property name=students type=java.util.ArrayList /
 /form-bean
 
 And in validation.xml I place my validation rules...
 
 form name=studentsForm 
field property=id indexedListProperty=students
 depends=required
  arg0 key=error.studentid.required/
 /field
field property=year indexedListProperty=students
 depends=required
  arg0 key=error.studentyear.required/
 /field
field  property=gradeAverage indexedListProperty=students
 depends=required
  arg0 key=error.studentgrade.required/
 /field
 /form
 
 Now here is where things start to go a bit pear-shaped
 
 I have read somewhere online that I need to populate the form ArrayList
 before I get to my jsp page. So I have created an action class called
 PreStudentsAction.java which takes the student ArrayList out of the
 session and assigns it to the student ArrayList in the form before
 forwarding to the students.jsp page...
 
 public class PreStudentsAction extends Action{
 
 public ActionForward execute(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws Exception
 {
 
 DynaValidatorForm myForm = (DynaValidatorForm)form;
 Group group = (Group)request.getSession().getAttribute(group);
 ArrayListStudent students = group.getStudentsList();
 
 myForm.set(students, students);   
 return (mapping.findForward(success));
 }
 
 }
 
 
 Finally when I run my application my table is displayed but when I fill
 in the table and press submit I get the IndexOutOfBounds error. It
 appears to me that the student ArrayList in the form remains empty and
 that my Action class was unsuccessful in populating the form's
 ArrayList.
 
 Can anybody see what I'm doing wrong?
 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Validation-of-indexed-properties-tp27493794p27720956.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation of indexed properties

2010-02-25 Thread Cielpa

Hey,

I have a similar problem with DynaValidatorActionForm.
It says that invalid property when i have a ArrayList in the form-property
name=searchList type=java.util.ArrayList/ in the form-bean
declaration.

Any idea?
 Thanks and your help is appreciated.
Silpa

hugh11 wrote:
 
 I've got a problem relating to the validation of indexed properties in
 Struts 1.1
 I get the following error message when I try to access an ArrayList of
 students in my DynaValidatorForm
 
 root cause 
 
 java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
 java.util.ArrayList.RangeCheck(Unknown Source)
 java.util.ArrayList.get(Unknown Source)
 org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:298)
 
 
 
 Here is some background to the problem...
 
 In my session I have an ArrayList called studentsList of objects of type
 experiment.mybeans.Student. A Student object has getter and setter methods
 for id, year and gradeAverage.
 
 In my students.jsp I create a table by iterating through my student
 objects like this...
 
 c:forEach var=students items=${sessionScope.group.studentsList} 
   trtdhtml:text indexed=true name=students property=id//td
   tdhtml:text indexed=true name=students property=year//td
   tdhtml:text indexed=true name=students
 property=gradeAverage//td/tr
 /c:forEach
 
 As you can see the table contains empty text boxes and I would like to
 validate these have been filled in, so in struts-config.xml I create my
 dynavalidatorform as follows...
 
 form-bean name=studentsForm
 type=org.apache.struts.validator.DynaValidatorForm 
 form-property name=students type=java.util.ArrayList /
 /form-bean
 
 And in validation.xml I place my validation rules...
 
 form name=studentsForm 
field property=id indexedListProperty=students depends=required
  arg0 key=error.studentid.required/
 /field
field property=year indexedListProperty=students
 depends=required
  arg0 key=error.studentyear.required/
 /field
field  property=gradeAverage indexedListProperty=students
 depends=required
  arg0 key=error.studentgrade.required/
 /field
 /form
 
 Now here is where things start to go a bit pear-shaped
 
 I have read somewhere online that I need to populate the form ArrayList
 before I get to my jsp page. So I have created an action class called
 PreStudentsAction.java which takes the student ArrayList out of the
 session and assigns it to the student ArrayList in the form before
 forwarding to the students.jsp page...
 
 public class PreStudentsAction extends Action{
   
   public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
   {
   
   DynaValidatorForm myForm = (DynaValidatorForm)form;
   Group group = (Group)request.getSession().getAttribute(group);
   ArrayListStudent students = group.getStudentsList();
   
   myForm.set(students, students);   
   return (mapping.findForward(success));
   }
 
 }
 
 
 Finally when I run my application my table is displayed but when I fill in
 the table and press submit I get the IndexOutOfBounds error. It appears to
 me that the student ArrayList in the form remains empty and that my Action
 class was unsuccessful in populating the form's ArrayList.
 
 Can anybody see what I'm doing wrong?
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Validation-of-indexed-properties-tp27493794p27714507.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: validation in struts2

2010-01-21 Thread Shasha

Thanks all.

It was working fine after changing to LoginAction-validation.xml .


musomesa wrote:
 
 
  Also, the file should be LoginAction-validation.xml . Use the
 config-browser to see that you have the validators in place. 
 
  
 
 Chris
  
 
  
 
 -Original Message-
 From: Gabriel Belingueres belingue...@gmail.com
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Wed, Jan 20, 2010 10:12 am
 Subject: Re: validation in struts2
 
 
 the form tag is wrong?
 
 try:
 
 s:form action=doLogin namespace=/tricky
 
 2010/1/19 Shasha sarada.i...@yahoo.com:

 Hi All,

 I am not able to get the validation errors from Login-validation.xml when
 i
 am using Modeldriven .

 Login-validation.xml
   1. !DOCTYPE validators PUBLIC
   2. -//OpenSymphony Group//XWork Validator 1.0.2//EN
   3.
 http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;
   4.
   5. validators
   6. field name=username
   7. field-validator type=requiredstring
   8. message key=requiredstring/
   9. /field-validator
  10. /field
  11. field name=password
  12. field-validator type=requiredstring
  13. message key=requiredstring/
  14. /field-validator
  15. /field
  16. /validators

 LoginAction.java

   1. public class LoginAction extends ActionSupport implements
 ModelDriven,SessionAware{
   2.
   3. private User user = new User();
   4. private Map session;
   5. private UserDAO userDAO = new UserDAOImpl();
   6.
   7. public String execute() throws Exception {
   8.
   9. boolean success=userDAO.verifyUser(user);
  10. if (success)
  11. return SUCCESS;
  12. else
  13. return ERROR;
  14. }
  15.
  16. public Object getModel() {
  17. return user;
  18. }
  19.
  20. public void setSession(Map session) {
  21. this.session=session;
  22. }
  23.
  24. public Map getSession() {
  25. return session;
  26. }
  27.
  28. }

 login.jsp

   1. %@ taglib prefix=s uri=/struts-tags %
   2. html
   3. head
   4. titleStruts 2 Login Application!/title
   5.
   6. link href=s:url value=/css/main.css/ rel=stylesheet
 type=text/css/
   7.
   8. /head
   9. body
  10. s:form action=doLogin.action method=POST
  11. tr
  12. td colspan=2Login/td
  13. /tr
  14. tr
  15.td colspan=2
  16. s:actionerror /
  17.  s:fielderror /
  18./td
  19. /tr
  20.
  21. s:textfield name=username label=Login name/
  22. s:password name=password label=Password/
  23. s:submit value=Login align=center/
  24.
  25. /s:form
  26.
  27. /body
  28.
  29. /html

 http://old.nabble.com/file/p27236040/error.jpg


 --
 View this message in context:
 http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://old.nabble.com/validation-in-struts2-tp27236040p27266241.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: validation in struts2

2010-01-20 Thread Gabriel Belingueres
the form tag is wrong?

try:

s:form action=doLogin namespace=/tricky

2010/1/19 Shasha sarada.i...@yahoo.com:

 Hi All,

 I am not able to get the validation errors from Login-validation.xml when i
 am using Modeldriven .

 Login-validation.xml
   1. !DOCTYPE validators PUBLIC
   2.         -//OpenSymphony Group//XWork Validator 1.0.2//EN
   3.         http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;
   4.
   5. validators
   6.     field name=username
   7.         field-validator type=requiredstring
   8.             message key=requiredstring/
   9.         /field-validator
  10.     /field
  11.     field name=password
  12.         field-validator type=requiredstring
  13.             message key=requiredstring/
  14.         /field-validator
  15.     /field
  16. /validators

 LoginAction.java

   1. public class LoginAction extends ActionSupport implements
 ModelDriven,SessionAware{
   2.
   3.     private User user = new User();
   4.     private Map session;
   5.     private UserDAO userDAO = new UserDAOImpl();
   6.
   7.     public String execute() throws Exception {
   8.
   9.         boolean success=userDAO.verifyUser(user);
  10.         if (success)
  11.         return SUCCESS;
  12.         else
  13.         return ERROR;
  14.     }
  15.
  16.     public Object getModel() {
  17.         return user;
  18.     }
  19.
  20.     public void setSession(Map session) {
  21.         this.session=session;
  22.     }
  23.
  24.     public Map getSession() {
  25.         return session;
  26.     }
  27.
  28. }

 login.jsp

   1. %@ taglib prefix=s uri=/struts-tags %
   2. html
   3. head
   4. titleStruts 2 Login Application!/title
   5.
   6. link href=s:url value=/css/main.css/ rel=stylesheet
 type=text/css/
   7.
   8. /head
   9. body
  10. s:form action=doLogin.action method=POST
  11. tr
  12.     td colspan=2Login/td
  13. /tr
  14. tr
  15.    td colspan=2
  16.         s:actionerror /
  17.          s:fielderror /
  18.    /td
  19. /tr
  20.
  21.     s:textfield name=username label=Login name/
  22.     s:password name=password label=Password/
  23.     s:submit value=Login align=center/
  24.
  25. /s:form
  26.
  27. /body
  28.
  29. /html

 http://old.nabble.com/file/p27236040/error.jpg


 --
 View this message in context: 
 http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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



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



Re: validation in struts2

2010-01-20 Thread musomesa

 Also, the file should be LoginAction-validation.xml . Use the config-browser 
to see that you have the validators in place. 

 

Chris
 

 

-Original Message-
From: Gabriel Belingueres belingue...@gmail.com
To: Struts Users Mailing List user@struts.apache.org
Sent: Wed, Jan 20, 2010 10:12 am
Subject: Re: validation in struts2


the form tag is wrong?

try:

s:form action=doLogin namespace=/tricky

2010/1/19 Shasha sarada.i...@yahoo.com:

 Hi All,

 I am not able to get the validation errors from Login-validation.xml when i
 am using Modeldriven .

 Login-validation.xml
   1. !DOCTYPE validators PUBLIC
   2. -//OpenSymphony Group//XWork Validator 1.0.2//EN
   3. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;
   4.
   5. validators
   6. field name=username
   7. field-validator type=requiredstring
   8. message key=requiredstring/
   9. /field-validator
  10. /field
  11. field name=password
  12. field-validator type=requiredstring
  13. message key=requiredstring/
  14. /field-validator
  15. /field
  16. /validators

 LoginAction.java

   1. public class LoginAction extends ActionSupport implements
 ModelDriven,SessionAware{
   2.
   3. private User user = new User();
   4. private Map session;
   5. private UserDAO userDAO = new UserDAOImpl();
   6.
   7. public String execute() throws Exception {
   8.
   9. boolean success=userDAO.verifyUser(user);
  10. if (success)
  11. return SUCCESS;
  12. else
  13. return ERROR;
  14. }
  15.
  16. public Object getModel() {
  17. return user;
  18. }
  19.
  20. public void setSession(Map session) {
  21. this.session=session;
  22. }
  23.
  24. public Map getSession() {
  25. return session;
  26. }
  27.
  28. }

 login.jsp

   1. %@ taglib prefix=s uri=/struts-tags %
   2. html
   3. head
   4. titleStruts 2 Login Application!/title
   5.
   6. link href=s:url value=/css/main.css/ rel=stylesheet
 type=text/css/
   7.
   8. /head
   9. body
  10. s:form action=doLogin.action method=POST
  11. tr
  12. td colspan=2Login/td
  13. /tr
  14. tr
  15.td colspan=2
  16. s:actionerror /
  17.  s:fielderror /
  18./td
  19. /tr
  20.
  21. s:textfield name=username label=Login name/
  22. s:password name=password label=Password/
  23. s:submit value=Login align=center/
  24.
  25. /s:form
  26.
  27. /body
  28.
  29. /html

 http://old.nabble.com/file/p27236040/error.jpg


 --
 View this message in context: 
 http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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



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

 


RE: validation in struts2

2010-01-20 Thread Raghuveer
Your XML file needs to be renamed as,LoginAction-validation.xml

-Original Message-
From: Gabriel Belingueres [mailto:belingue...@gmail.com] 
Sent: Wednesday, January 20, 2010 8:43 PM
To: Struts Users Mailing List
Subject: Re: validation in struts2

the form tag is wrong?

try:

s:form action=doLogin namespace=/tricky

2010/1/19 Shasha sarada.i...@yahoo.com:

 Hi All,

 I am not able to get the validation errors from Login-validation.xml when
i
 am using Modeldriven .

 Login-validation.xml
   1. !DOCTYPE validators PUBLIC
   2.         -//OpenSymphony Group//XWork Validator 1.0.2//EN
   3.        
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;
   4.
   5. validators
   6.     field name=username
   7.         field-validator type=requiredstring
   8.             message key=requiredstring/
   9.         /field-validator
  10.     /field
  11.     field name=password
  12.         field-validator type=requiredstring
  13.             message key=requiredstring/
  14.         /field-validator
  15.     /field
  16. /validators

 LoginAction.java

   1. public class LoginAction extends ActionSupport implements
 ModelDriven,SessionAware{
   2.
   3.     private User user = new User();
   4.     private Map session;
   5.     private UserDAO userDAO = new UserDAOImpl();
   6.
   7.     public String execute() throws Exception {
   8.
   9.         boolean success=userDAO.verifyUser(user);
  10.         if (success)
  11.         return SUCCESS;
  12.         else
  13.         return ERROR;
  14.     }
  15.
  16.     public Object getModel() {
  17.         return user;
  18.     }
  19.
  20.     public void setSession(Map session) {
  21.         this.session=session;
  22.     }
  23.
  24.     public Map getSession() {
  25.         return session;
  26.     }
  27.
  28. }

 login.jsp

   1. %@ taglib prefix=s uri=/struts-tags %
   2. html
   3. head
   4. titleStruts 2 Login Application!/title
   5.
   6. link href=s:url value=/css/main.css/ rel=stylesheet
 type=text/css/
   7.
   8. /head
   9. body
  10. s:form action=doLogin.action method=POST
  11. tr
  12.     td colspan=2Login/td
  13. /tr
  14. tr
  15.    td colspan=2
  16.         s:actionerror /
  17.          s:fielderror /
  18.    /td
  19. /tr
  20.
  21.     s:textfield name=username label=Login name/
  22.     s:password name=password label=Password/
  23.     s:submit value=Login align=center/
  24.
  25. /s:form
  26.
  27. /body
  28.
  29. /html

 http://old.nabble.com/file/p27236040/error.jpg


 --
 View this message in context:
http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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





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



Re: validation question

2010-01-08 Thread Gabriel Belingueres
As a starting point you may check the freemarker .ftl files from the
XHTML template.

2010/1/8 Robby Atchison rob...@msn.com:
 Hello,  I would like to know how an actionname-validation.xml is tied to the
 client-side validation.  I figure somewhere the xml file is read and
 Javascript is output.  I'm having trouble connecting the dots.  Any
 information and help will be appreciated.



 Best regards!



 Robby

 rob...@msn.com





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



Re: Validation and conversion conflict - best method?

2009-11-30 Thread carl ballantyne

Hi Ben,

Are you throwing a  
com.opensymphony.xwork2.conversion.TypeConversionException exception  
in your converter class when there is a problem converting the date?


I have the following for my converter class:

public class DateConverter extends StrutsTypeConverter {
private static Logger logger = Logger.getLogger(DateConverter.class);

private static SimpleDateFormat sdf = new SimpleDateFormat();

static {
sdf.applyPattern(dd/MM/);
sdf.setLenient(false);
}

public Object convertFromString(Map context, String[] values,  
Class toClass) {

if (values != null  values.length == 1) {
if (values[0] != null  !values[0].equals()) {

Pattern p = 
Pattern.compile([0-9]{2}/[0-9]{2}/[0-9]{4});
 Matcher m = p.matcher(values[0]);
 boolean b = m.matches();
 if (!b)
 throw new TypeConversionException(Invalid date 
format.);

try {
logger.debug(Parsing  + values[0] +  to a 
date.);
Date date = sdf.parse(values[0]);
return date;
} catch (ParseException e) {
e.printStackTrace();
throw new TypeConversionException(e);
}
}
}

return null;
 }

 public String convertToString(Map context, Object o) {
 if (o != null  o instanceof Date) {
return sdf.format(o);
 }
 return ;
 }
}



And then you need to point your converter at the field as per the  
documentation.


Cheers,
Carl.



Quoting ben_979 benninesevenn...@yahoo.ca:



Carl, if I could bother you for a few more details?

I like your solution, it seems elegant (to me at least!). I'm trying to
implement it, but I'm not getting the results that you are.

I've set up the type converter, and I've verified that it is being invoked.


When my conversion fails (for example, I just type random strings into the
date field of my form), the converter is invoked, and the date conversion
fails (which is correct). However, when I look in the logs, I see that it is
trying to invoke a set method for my date field with a String value as the
parameter ( setDateTime(String) ) which I don't have, because dateTime is
expected to be of type Date.

If I enter a date in the proper format, everything works as expected.


From the jsp:
s:textfield name=schedule.dateTime
value=%{getText('detail.date',{schedule.dateTime})} label=Date/Time/
//detail.date is for formatting

From the validation.xml
field name=schedule.dateTime
  field-validator type=conversion short-circuit=true
message Try another format /message
  /field-validator
/field



Thanks in advance, if you have a chance to respond.

--
View this message in context:   
http://old.nabble.com/Validation-and-conversion-conflict---best-method--tp26341189p26545367.html

Sent from the Struts - User mailing list archive at Nabble.com.


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







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



Re: validation xml file

2009-11-29 Thread Denis Cabasson

Do you have a result named input tied to your LoginAction? What is it?

Denis.

Nguyen Xuan Son a écrit :

Dear all
I have these in the LoginAction-validation.xml file
validators
field name=txtName
field-validator type=requiredstring
param name=trimfalse/param
messageerror/message
/field-validator
/field
 field name=txtPass
field-validator type=requiredstring
param name=trimfalse/param
messageerror/message
/field-validator
/field
/validators

but it seems that even there is a error it still continue to implement the
LoginAction.java file
what should i do if i want it stop implementing the LoginAction.java
whenever there is any error appear
thank you very much

  



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



Re: validation xml file

2009-11-29 Thread Nguyen Xuan Son
I think i have it. here is the detail
action name=login class=com.baibai.action.LoginAction
result name=successC0002_Home.jsp/result
result name=inputlogin.jsp/result
/action

Here is the HTML tag for the submit button
input type=image alt=Login border=0 src=images/login_btn_arr.gif
width=26 height=26 style=cursor:hand

Please tell me what should i correct?
thank you very much

2009/11/30 Denis Cabasson denis.cabas...@gmail.com

 Do you have a result named input tied to your LoginAction? What is it?

 Denis.

 Nguyen Xuan Son a écrit :

  Dear all
 I have these in the LoginAction-validation.xml file
 validators
 field name=txtName
 field-validator type=requiredstring
 param name=trimfalse/param
 messageerror/message
 /field-validator
 /field
  field name=txtPass
 field-validator type=requiredstring
 param name=trimfalse/param
 messageerror/message
 /field-validator
 /field
 /validators

 but it seems that even there is a error it still continue to implement the
 LoginAction.java file
 what should i do if i want it stop implementing the LoginAction.java
 whenever there is any error appear
 thank you very much





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




-- 
===
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add   : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email: nr000...@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246  URL  : http://www.ritsumei.jp
===


Re: validation xml file

2009-11-29 Thread Denis Cabasson

Everything seems to be looking good.

Is your validation xml file in the same package as your action? Are you 
using the defaultStack interceptor stack?


If you leave txtName or txtPass empty, are you still proceeding to 
C0002_Home.jsp?


Something must not be in place, because your example seems simple enough 
and definitely should be working. I tried at my place, and everything's 
working fine, so you must have some misconfiguration somewhere.


Can you share more of your code? What is your complete struts.xml?

Good luck!
Denis.

Nguyen Xuan Son a écrit :

I think i have it. here is the detail
action name=login class=com.baibai.action.LoginAction
result name=successC0002_Home.jsp/result
result name=inputlogin.jsp/result
/action

Here is the HTML tag for the submit button
input type=image alt=Login border=0 
src=images/login_btn_arr.gif width=26 height=26 style=cursor:hand


Please tell me what should i correct?
thank you very much

2009/11/30 Denis Cabasson denis.cabas...@gmail.com 
mailto:denis.cabas...@gmail.com


Do you have a result named input tied to your LoginAction? What
is it?

Denis.

Nguyen Xuan Son a écrit :

Dear all
I have these in the LoginAction-validation.xml file
validators
field name=txtName
field-validator type=requiredstring
param name=trimfalse/param
messageerror/message
/field-validator
/field
 field name=txtPass
field-validator type=requiredstring
param name=trimfalse/param
messageerror/message
/field-validator
/field
/validators

but it seems that even there is a error it still continue to
implement the
LoginAction.java file
what should i do if i want it stop implementing the
LoginAction.java
whenever there is any error appear
thank you very much

 




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




--
===
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add   : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 
ShiteiHaimu Rien, Room 103

Tel/Fax  : 81-(0)90-3976 2246
Email: nr000...@ed.ritsumei.ac.jp mailto:nr000...@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246  URL  : http://www.ritsumei.jp
===



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



Re: validation xml file

2009-11-29 Thread Nguyen Xuan Son
Dear denis
i've attached the struts.xml file with this email
the problem is when i dont input any information
the system doesnt stop immediatly at LoginAction-validation.xml file but
also implement LoginAction.java file
thus the system check everything even it is not necessary
it might make the system slower

thank you very much

2009/11/30 Denis Cabasson denis.cabas...@gmail.com

 Everything seems to be looking good.

 Is your validation xml file in the same package as your action? Are you
 using the defaultStack interceptor stack?

 If you leave txtName or txtPass empty, are you still proceeding to
 C0002_Home.jsp?

 Something must not be in place, because your example seems simple enough
 and definitely should be working. I tried at my place, and everything's
 working fine, so you must have some misconfiguration somewhere.

 Can you share more of your code? What is your complete struts.xml?

 Good luck!

 Denis.

 Nguyen Xuan Son a écrit :

 I think i have it. here is the detail

 action name=login class=com.baibai.action.LoginAction
 result name=successC0002_Home.jsp/result
 result name=inputlogin.jsp/result
 /action

 Here is the HTML tag for the submit button
 input type=image alt=Login border=0 src=images/login_btn_arr.gif
 width=26 height=26 style=cursor:hand

 Please tell me what should i correct?
 thank you very much

 2009/11/30 Denis Cabasson denis.cabas...@gmail.com mailto:
 denis.cabas...@gmail.com


Do you have a result named input tied to your LoginAction? What
is it?

Denis.

Nguyen Xuan Son a écrit :

Dear all
I have these in the LoginAction-validation.xml file
validators
field name=txtName
field-validator type=requiredstring
param name=trimfalse/param
messageerror/message
/field-validator
/field
 field name=txtPass
field-validator type=requiredstring
param name=trimfalse/param
messageerror/message
/field-validator
/field
/validators

but it seems that even there is a error it still continue to
implement the
LoginAction.java file
what should i do if i want it stop implementing the
LoginAction.java
whenever there is any error appear
thank you very much




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
mailto:user-unsubscr...@struts.apache.org

For additional commands, e-mail: user-h...@struts.apache.org
mailto:user-h...@struts.apache.org





 --
 ===
 Ritsumeikan University, Asia JinZai Project
 Master of Information Science
 Nguyen Xuan Son

 Add   : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
 ShiteiHaimu Rien, Room 103
 Tel/Fax  : 81-(0)90-3976 2246
 Email: nr000...@ed.ritsumei.ac.jp mailto:nr000...@ed.ritsumei.ac.jp

 Mobile   : 81-(0)90-3976 2246  URL  : http://www.ritsumei.jp
 ===



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




-- 
===
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add   : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email: nr000...@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246  URL  : http://www.ritsumei.jp
===
?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
	package name=struts2 extends=struts-default
		action name=login class=com.baibai.action.LoginAction
			result name=successC0002_Home.jsp/result
			result name=inputlogin.jsp/result
		/action
		
		action name=logout class=com.baibai.action.LogoutAction
			result name=successlogin.jsp/result
			result name=inputlogout.jsp/result
		/action
		
		action name=SessionCheck class=com.baibai.action.SessionCheckAction
			result name=inputsessionChk.jsp/result
		/action
		
		action name=C0002_Home class=com.baibai.action.C0002_HomeAction
			result name=inputC0002_Home.jsp/result
		/action
		
		action name=C0003_ChangePassword class=com.baibai.action.C0003_ChangePasswordAction
			result name=successC0002_Home.jsp/result
			result name=inputC0003_ChangePassword.jsp/result
		/action
	/package

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

Re: Validation and conversion conflict - best method?

2009-11-27 Thread ben_979

Carl, if I could bother you for a few more details?

I like your solution, it seems elegant (to me at least!). I'm trying to
implement it, but I'm not getting the results that you are.

I've set up the type converter, and I've verified that it is being invoked.


When my conversion fails (for example, I just type random strings into the
date field of my form), the converter is invoked, and the date conversion
fails (which is correct). However, when I look in the logs, I see that it is
trying to invoke a set method for my date field with a String value as the
parameter ( setDateTime(String) ) which I don't have, because dateTime is
expected to be of type Date.

If I enter a date in the proper format, everything works as expected.


From the jsp:
s:textfield name=schedule.dateTime
value=%{getText('detail.date',{schedule.dateTime})} label=Date/Time/
//detail.date is for formatting

From the validation.xml
field name=schedule.dateTime
  field-validator type=conversion short-circuit=true
message Try another format /message
  /field-validator 
/field



Thanks in advance, if you have a chance to respond.

-- 
View this message in context: 
http://old.nabble.com/Validation-and-conversion-conflict---best-method--tp26341189p26545367.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation and conversion conflict - best method?

2009-11-27 Thread Saeed Iqbal
Normally values go from JSP as String. Parse it using Date Formatter and
convert it to Date yourself :)

I have very interesting experiences with this.

On Sat, Nov 28, 2009 at 12:05 AM, ben_979 benninesevenn...@yahoo.ca wrote:


 Carl, if I could bother you for a few more details?

 I like your solution, it seems elegant (to me at least!). I'm trying to
 implement it, but I'm not getting the results that you are.

 I've set up the type converter, and I've verified that it is being invoked.


 When my conversion fails (for example, I just type random strings into the
 date field of my form), the converter is invoked, and the date conversion
 fails (which is correct). However, when I look in the logs, I see that it
 is
 trying to invoke a set method for my date field with a String value as the
 parameter ( setDateTime(String) ) which I don't have, because dateTime is
 expected to be of type Date.

 If I enter a date in the proper format, everything works as expected.


 From the jsp:
 s:textfield name=schedule.dateTime
 value=%{getText('detail.date',{schedule.dateTime})} label=Date/Time/
 //detail.date is for formatting

 From the validation.xml
 field name=schedule.dateTime
  field-validator type=conversion short-circuit=true
message Try another format /message
  /field-validator
 /field



 Thanks in advance, if you have a chance to respond.

 --
 View this message in context:
 http://old.nabble.com/Validation-and-conversion-conflict---best-method--tp26341189p26545367.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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




-- 
Saeed Iqbal
http://www.iqbalconsulting.com
Struts - J2EE - Application Architect / Developer


Re: Validation and conversion conflict - best method?

2009-11-13 Thread Siddiq Syed

One quick solution might be , which I am using but most of them may not agree
with me,

-- Delcare a string in the action which take the value enter in the text
box.
-- Add the validation in the validation.xml as a regular expression and can
add as requiredString , if the filed is mandatory to enter.
-- The regular expression will check the format of the date.
-- once validation passes can convert the string to date throught the util.

Its an alternate solution.

- Siddiq.


ben_979 wrote:
 
 
 I have an object with a java.util.Date field. I present the object inside
 a form with the following tag:
 
 s:textfield key=detail.date
 value=%{getText('detail.date',{schedule.dateTime})} label=Date/Time/
 
 where detail.date is a date formatting pattern.
 
 The problem arises because after getText(), the field is populated with a
 String. When the String is submitted, I get an error because I don't have
 a setDateTime(String) method.
 
 I've written a data type conversion routine and applied it to the field,
 and it works fine as long as the user enters a date string in a valid
 format. If an invalid string is entered, the type conversion fails and a
 null is returned - so the user doesn't see the original date string, or
 even the incorrect one they entered - they see 'null'.
 
 So, I tried to add validation (using a validation xml file). However, it
 seems that the conversion is done regardless of whether or not the
 validation fails, so I end up with the same results.
 
 Next, I tried to implement the validation using the validate() method in
 the class, but I'm having similar troubles - I need to use the converter
 to convert the String to a Date - and I end up with all the previously
 described problems. If I don't use a converter, the field is null when it
 gets to the validate() method. 
 
 It isn't practical for me to change the class that contains the Date field
 to add a setDateTime(String) method. It seems like a hack to use a
 variable outside of the class to hold the Date in String form and then
 worry about keeping it in sync with the actual object.
 
 I can't be the first to struggle with this, so I'd be interested in
 hearing how some of you have solved this in the past - is there a clean
 and elegant solution?
 
 Thanks in advance!
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Validation-and-conversion-conflict---best-method--tp26341189p26341590.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation and conversion conflict - best method?

2009-11-13 Thread carl ballantyne

Hi Ben,

I think I understand your problem. I am have a similar situation where  
I have a person class with a birthday.


I ended up writing a Converter to handle the date (because I needed it  
in the format dd/mm/). I used the Person-conversion.properties to  
say that I want that converter applied to that field. And for the  
validation I have something like the following in the  
Person-validation.xml file.


field name=birthday
   field-validator type=conversion
	  message${getText(persona.birthday)} :  
${getText(validation.invalid)}/message

   /field-validator
/field

So my converter handles the case where there is no date. I don't have  
to use the getText method. I just refer to the property as I would  
with a normal field.


Then my converter throws a conversion exception if there are problems  
converting the date. I then catch this with the above line in my  
validation.xml.


I am new to the Struts 2 world but I think this is a relatively clean  
solution. Happy to hear if anyone else has a better way.


Cheers, Carl.


Quoting ben_979 benninesevenn...@yahoo.ca:




I have an object with a java.util.Date field. I present the object inside a
form with the following tag:

s:textfield key=detail.date
value=%{getText('detail.date',{schedule.dateTime})} label=Date/Time/

where detail.date is a date formatting pattern.

The problem arises because after getText(), the field is populated with a
String. When the String is submitted, I get an error because I don't have a
setDateTime(String) method.

I've written a data type conversion routine and applied it to the field, and
it works fine as long as the user enters a date string in a valid format. If
an invalid string is entered, the type conversion fails and a null is
returned - so the user doesn't see the original date string, or even the
incorrect one they entered - they see 'null'.

So, I tried to add validation (using a validation xml file). However, it
seems that the conversion is done regardless of whether or not the
validation fails, so I end up with the same results.

Next, I tried to implement the validation using the validate() method in the
class, but I'm having similar troubles - I need to use the converter to
convert the String to a Date - and I end up with all the previously
described problems. If I don't use a converter, the field is null when it
gets to the validate() method.

It isn't practical for me to change the class that contains the Date field
to add a setDateTime(String) method. It seems like a hack to use a variable
outside of the class to hold the Date in String form and then worry about
keeping it in sync with the actual object.

I can't be the first to struggle with this, so I'd be interested in hearing
how some of you have solved this in the past - is there a clean and elegant
solution?

Thanks in advance!


--
View this message in context:   
http://old.nabble.com/Validation-and-conversion-conflict---best-method--tp26341189p26341189.html

Sent from the Struts - User mailing list archive at Nabble.com.


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







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



Re: Validation and conversion conflict - best method?

2009-11-13 Thread ben_979


I have a related question, but it's a bit of a side-track as I try to solve
my original problem.

What is the naming convention and the difference between the two types of
-validation.xml file naming? 

I think I understand that ActionClass-validation.xml is called for all
(non-excluded) methods in the Action.

The documentation on the other method is very scarce and difficult to
understand. It suggests that the name should be
ActionClass-ActionAlias-validation.xml, however it isn't really clear what
ActionAlias really means.

In my case, my action class is called ScheduleDetail. The form that invokes
the update is coded as follows :

s:form action=ScheduleDetail_update

So, my understanding is that if I want validation ONLY for this method, the
naming convention should be:

ScheduleDetail-ScheduleDetail_update-validation.xml

Is this correct?

I've tried ScheduleDetail-validation.xml just to use the basic naming
definition, but it doesn't seem to get invoked. The messages that I have
defined in the file are never presented, I am seeing what I think are
generic struts error messages for type conversion errors (I'm trying to
force failure by entering a string in an int field).


-- 
View this message in context: 
http://old.nabble.com/Validation-and-conversion-conflict---best-method--tp26341189p26345292.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: validation

2009-08-19 Thread Sandy.Verfaille
Yes, that was a copy-mistake of me.
In my app it is 'be.shop.service.ProductActions 

-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-nameStruts 2 - Maven Archetype - Starter/display-name
filter
filter-nameaction2-cleanup/filter-name

filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter
-class
/filter
filter
filter-nameaction2/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
/filter
filter-mapping
filter-nameaction2-cleanup/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-nameaction2/filter-name
url-pattern/*/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.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=minInclusive0.0/param  
 param name=maxInclusive3.0/param  
 messageWeight has to be numeric and can't be less than
0./message  
 /field-validator  
 /field
/validators 




-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@roularta.be
To: user

Re: validation

2009-08-19 Thread mailtolouis2020-struts
Hi,

In your action did you extends ActionSupport or implement Validateable ?

Louis




From: sandy.verfai...@roularta.be sandy.verfai...@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-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-nameStruts 2 - Maven Archetype - Starter/display-name
filter
filter-nameaction2-cleanup/filter-name

filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter
-class
/filter
filter
filter-nameaction2/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
/filter
filter-mapping
filter-nameaction2-cleanup/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-nameaction2/filter-name
url-pattern/*/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.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=minInclusive0.0/param  
 param name=maxInclusive3.0/param  
 messageWeight has to be numeric and can't be less than
0./message  
 /field-validator  
 /field
/validators 




-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-str...@yahoo.com
[mailto:mailtolouis2020-str...@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts

RE: validation

2009-08-19 Thread Sandy.Verfaille
I extended ActionSupport 

-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-nameStruts 2 - Maven Archetype - Starter/display-name
filter
filter-nameaction2-cleanup/filter-name

filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter
-class
/filter
filter
filter-nameaction2/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
/filter
filter-mapping
filter-nameaction2-cleanup/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-nameaction2/filter-name
url-pattern/*/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.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=minInclusive0.0/param  
 param name=maxInclusive3.0/param  
 messageWeight has to be numeric and can't be less than
0./message  
 /field-validator  
 /field
/validators 




-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@roularta.be
To: user@struts.apache.org
Sent: Monday, August 17, 2009 2

RE: validation

2009-08-18 Thread Sandy.Verfaille


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-nameStruts 2 - Maven Archetype -
Starter/display-name
filter
filter-nameaction2-cleanup/filter-name

filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter
-class
/filter
filter
filter-nameaction2/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
/filter
filter-mapping
filter-nameaction2-cleanup/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-nameaction2/filter-name
url-pattern/*/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.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=minInclusive0.0/param  
 param name=maxInclusive3.0/param  
 messageWeight has to be numeric and can't be less than
0./message  
 /field-validator  
 /field  
 /validators 




-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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

Re: validation

2009-08-18 Thread mailtolouis2020-struts
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.verfai...@roularta.be sandy.verfai...@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-nameStruts 2 - Maven Archetype -
Starter/display-name
filter
filter-nameaction2-cleanup/filter-name

filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter
-class
/filter
filter
filter-nameaction2/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-cla
ss
/filter
filter-mapping
filter-nameaction2-cleanup/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-nameaction2/filter-name
url-pattern/*/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.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=minInclusive0.0/param  
 param name=maxInclusive3.0/param  
 messageWeight has to be numeric and can't be less than
0./message  
 /field-validator  
 /field  
/validators 




-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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-str...@yahoo.com
[mailto:mailtolouis2020-str...@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.verfai...@roularta.be sandy.verfai...@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

  1   2   3   4   5   6   7   8   9   10   >