Re: validator type="regex" : param name is regex , not expression

2013-09-19 Thread Chris
Thanks for the informations




 De : Lukasz Lenart 
À : Struts Users Mailing List  
Envoyé le : Jeudi 19 septembre 2013 7h59
Objet : Re: validator type="regex" : param name is regex , not expression
 

Sometime ago ... with 2.3.12. I have renamed expression to regex as
right now you can define regexExpression as Ognl expression - there
was name clash without renaming ;-)

http://struts.apache.org/development/2.x/docs/version-notes-23120.html

2013/9/18 Chris :
> Hello ,
>
> Do you have any idea since when ( which version ) the word expression is no
> more  avaliable ?
> In some examples on the Web or in Books, the word used is still
> "expression".
>
> Regards
>
> Chris
>
> ---
>
>
> Done, thanks for reporting!
>
> https://cwiki.apache.org/confluence/display/WW/Form+Validation+Using+XML
>
> 2013/9/16 Chris
>
>> Hi Lukasz,
>>
>> Good example of regex in
>> http://struts.apache.org/development/2.x/docs/form-validation-using-xml.html
> ,
>> and choose  between JavaScript validator or Java validator will be another
>> story .;-)
>>
>>
>> but the file EditAction-validation.xml seems contain a wrong value.
>> .
>>
>> I found it in testing PhoneNumber with many wrong values and it always
>> worked !
>> I thought maybe a jar is missing ?
>>
>> But it was the param name in the file EditAction-validation.xml
>> ->  should be 
>>
>> before
>> 
>>     personBean.phoneNumber
>>     
>>     Phone number must be entered as 999-999-.
>> 
>>
>> after
>> 
>>     personBean.phoneNumber
>>     
>>     Phone number must be entered as 999-999-.
>> 
>>
>>
>>
>>
>> Regards,
>>
>> Chris ( christalkto )
>>
>>
>> __



-- 
Ł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: validator type="regex" : param name is regex , not expression

2013-09-18 Thread Lukasz Lenart
Sometime ago ... with 2.3.12. I have renamed expression to regex as
right now you can define regexExpression as Ognl expression - there
was name clash without renaming ;-)

http://struts.apache.org/development/2.x/docs/version-notes-23120.html

2013/9/18 Chris :
> Hello ,
>
> Do you have any idea since when ( which version ) the word expression is no
> more  avaliable ?
> In some examples on the Web or in Books, the word used is still
> "expression".
>
> Regards
>
> Chris
>
> ---
>
>
> Done, thanks for reporting!
>
> https://cwiki.apache.org/confluence/display/WW/Form+Validation+Using+XML
>
> 2013/9/16 Chris
>
>> Hi Lukasz,
>>
>> Good example of regex in
>> http://struts.apache.org/development/2.x/docs/form-validation-using-xml.html
> ,
>> and choose  between JavaScript validator or Java validator will be another
>> story .;-)
>>
>>
>> but the file EditAction-validation.xml seems contain a wrong value.
>> .
>>
>> I found it in testing PhoneNumber with many wrong values and it always
>> worked !
>> I thought maybe a jar is missing ?
>>
>> But it was the param name in the file EditAction-validation.xml
>> ->  should be 
>>
>> before
>> 
>> personBean.phoneNumber
>> 
>> Phone number must be entered as 999-999-.
>> 
>>
>> after
>> 
>> personBean.phoneNumber
>> 
>> Phone number must be entered as 999-999-.
>> 
>>
>>
>>
>>
>> Regards,
>>
>> Chris ( christalkto )
>>
>>
>> __



-- 
Ł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: validator type="regex" : param name is regex , not expression

2013-09-18 Thread Chris
Hello , 

Do you have any idea since when ( which version ) the word expression is no 
more  avaliable ? 
In some examples on the Web or in Books, the word used is still "expression".

Regards

Chris

---


Done, thanks for reporting!

https://cwiki.apache.org/confluence/display/WW/Form+Validation+Using+XML

2013/9/16 Chris 
> Hi Lukasz,
>
> Good example of regex in 
> http://struts.apache.org/development/2.x/docs/form-validation-using-xml.html
,
> and choose  between JavaScript validator or Java validator will be another 
> story .;-)
>
>
> but the file EditAction-validation.xml seems contain a wrong value.
> .
>
> I found it in testing PhoneNumber with many wrong values and it always worked 
> !
> I thought maybe a jar is missing ?
>
> But it was the param name in the file EditAction-validation.xml
> ->  should be 
>
> before
> 
> personBean.phoneNumber
> 
> Phone number must be entered as 999-999-.
> 
>
> after
> 
> personBean.phoneNumber
> 
> Phone number must be entered as 999-999-.
> 
>
>
>
>
> Regards,
>
> Chris ( christalkto )
>
>
> __

Re: validator type="regex" : param name is regex , not expression

2013-09-16 Thread Lukasz Lenart
Done, thanks for reporting!

https://cwiki.apache.org/confluence/display/WW/Form+Validation+Using+XML

2013/9/16 Chris :
> Hi Lukasz,
>
> Good example of regex in 
> http://struts.apache.org/development/2.x/docs/form-validation-using-xml.html ,
> and choose  between JavaScript validator or Java validator will be another 
> story .;-)
>
>
> but the file EditAction-validation.xml seems contain a wrong value.
> .
>
> I found it in testing PhoneNumber with many wrong values and it always worked 
> !
> I thought maybe a jar is missing ?
>
> But it was the param name in the file EditAction-validation.xml
> ->  should be 
>
> before
> 
> personBean.phoneNumber
> 
> Phone number must be entered as 999-999-.
> 
>
> after
> 
> personBean.phoneNumber
> 
> Phone number must be entered as 999-999-.
> 
>
>
>
>
> Regards,
>
> Chris ( christalkto )
>
>
> 

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



Re: Validator with annotations

2013-06-28 Thread Simone Camillo Buzzi
Hi, the goal that I'm trying to reach is to reduce the number of variables
and method into the Struts action to improve code readability and
maintainability.
I'm using hibernate, so I could obtain a good synergy if i can set value
coming from parameters directly into the hibernate model bean, maintaing
the validation at the action level as you recommends.
I prefer to don't insert struts annotation in hibernate bean, I don't know
which effect I can obtain in this way and I don't want to a dependency
between the model and struts.

I don't understand why I have this behaviour in the action. Does the
interceptor need a getter to evaluate the field? What's the convention?

Kind regards
Simone Buzzi


Re: Validator with annotations

2013-06-28 Thread Maurizio Cucchiara
Ciao Simone,

have a look at VisitorFieldValidator [1] [2] and model driven. IMO it's
better to keep the annotations inside the action rather than the bean (you
can have different use cases for the same model).


[1]
http://struts.apache.org/release/2.3.x/docs/visitorfieldvalidator-annotation.html
[2]
http://struts.apache.org/release/2.2.x/docs/using-visitor-field-validator.html

Twitter :http://www.twitter.com/m_cucchiara
G+  :https://plus.google.com/107903711540963855921
Linkedin:http://www.linkedin.com/in/mauriziocucchiara
VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara

Maurizio Cucchiara


On 28 June 2013 07:08, Simone Camillo Buzzi  wrote:

> Hi, I have some doubt about how to use validation annotation.
> I'm changing my code to make it more readable and maintainable.
>
> I started from an action where I had all setters with annotation and i put
> data in a private local variable
>
> ex.
> private String email;
>
> @RequiredStringValidator(key="fieldError.required", message = "*")
>  @EmailValidator (key="fieldError.emailFormat", message="*")
> public void setEmail(String email) {
>  this.email = email;
> }
>
> It functioned well but I neeed to reorganize my code.
> So, I create e class User where I directly put data coming from the web and
> I erase all the private variable in this way
>
> User user = null;
>  public User getUser() {
> if (user == null)
> user = new User();
>  return user;
> }
>
> @RequiredStringValidator(key="fieldError.required", message = "*")
>  @EmailValidator (key="fieldError.emailFormat", message="*")
> public void setEmail(String email) {
>  getUser().setEmail(email);
> }
>
> My bean receives data but validators stop to function, so I receive bad
> validation messages
> Does validator need a getter (not present also in the first release) or use
> reflection on local variables to check data?
> How can I implement my new data model in Struts2
>
> 
>   org.apache.struts
>   struts2-core
>   2.3.14
> 
>
>
> Kind regards
> Simone Buzzi
>


Re: Validator plugin error

2008-07-15 Thread danipruebas

OMG, this is an EPIC FAIL : )
Yes, i have saved and referenced it in WEB-INF.
Best regards,

- Original Message - 
From: "Lukasz Lenart" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Tuesday, July 15, 2008 7:23 PM
Subject: Re: Validator plugin error



As I remember, there is a bug with this, out dtd to WEB-INF and add
reference to it
http://www.developerdotstar.com/community/node/472


Regards
--
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Email procesado por MailFoundry



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Lukasz Lenart
As I remember, there is a bug with this, out dtd to WEB-INF and add
reference to it
http://www.developerdotstar.com/community/node/472


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread danipruebas

Hi again,
After updating all the dependencies and changing the DTD for the 
validation.xml and validation-rules.xml:

http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd";;>
I get the following warning:

file cannot be validated as the host "jakarta.apache.org" is currently 
unreachable
I suposed I can specify a path in local to the DTD, but I wouldn´t like to 
do it.
As a possible clue, I haven´t got Internet connection in the laptop i´m 
developing the project (only at home).


Any suggestions? Thx

- Original Message - 
From: "Lukasz Lenart" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Tuesday, July 15, 2008 3:36 PM
Subject: Re: Validator plugin error



15-jul-2008 15:06:33 org.apache.commons.digester.Digester fatalError
GRAVE: Parse Fatal Error at line -1 column -1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file.


You should also change dtd headers for validator-rules.xml and
validations.xml to reflect new common-validator.jar


Regards
--
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Email procesado por MailFoundry




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Lukasz Lenart
> 15-jul-2008 15:06:33 org.apache.commons.digester.Digester fatalError
> GRAVE: Parse Fatal Error at line -1 column -1: Premature end of file.
> org.xml.sax.SAXParseException: Premature end of file.

You should also change dtd headers for validator-rules.xml and
validations.xml to reflect new common-validator.jar


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Dave Newton
--- On Tue, 7/15/08, Dani <[EMAIL PROTECTED]> wrote:
> Should I update the depencies of commons-validator 1.3.1.
> as shown in this link?

Well yes; you can't just update a library and assume that it will work without 
its dependencies.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Dani

Lukasz Lenart escribió:

Check this

http://issues.apache.org/struts/browse/STR-2862?focusedCommentId=37312#action_37312

Maybe either you have duplicated commons-validator.jar or in wrong version?


Regards
  
I have updated commons-validator.jar to latest version 1.3.1 replacing 
the jar file in /WEB-INF/lib

Now I get the following error on loading Tomcat:

15-jul-2008 15:06:33 org.apache.commons.digester.Digester fatalError
GRAVE: Parse Fatal Error at line -1 column -1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file.

Should I update the depencies of commons-validator 1.3.1. as shown in 
this link?

http://mvnrepository.com/artifact/commons-validator/commons-validator/1.3.1

I´ve been "googling" around but didn´t see any clues.
Regards,


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Lukasz Lenart
Check this

http://issues.apache.org/struts/browse/STR-2862?focusedCommentId=37312#action_37312

Maybe either you have duplicated commons-validator.jar or in wrong version?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Dani

Lukasz Lenart escribió:

Hi,

Try to comment such entry for Validator plugin and check again, do you
have any logs from your container? Maybe the problem is elsewhere?


Regards
  


The validator-rules.xml & validations.xml are located under the correct 
path /WEB-INF/, as specified in the struts-config.xml file:

< plug-in className="org.apache.struts.validator.ValidatorPlugIn">
   


This is the error log at Catalina:

2008-07-15 13:17:34 StandardContext[/gentaiw]El Servlet /gentaiw lanzó 
excepción de load()
javax.servlet.UnavailableException: Cannot load a validator resource 
from '/WEB-INF/validator-rules.xml,/WEB-INF/validations.xml' --> *** 
ERROR ??? ***
   at 
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172)
   at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)

   at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
   at javax.servlet.GenericServlet.init(GenericServlet.java:211)
   at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
   at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
   at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
   at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
   at 
org.apache.catalina.core.StandardService.start(StandardService.java:480)
   at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

   at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator plugin error

2008-07-15 Thread Lukasz Lenart
Hi,

Try to comment such entry for Validator plugin and check again, do you
have any logs from your container? Maybe the problem is elsewhere?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator shortcuts idea

2007-10-16 Thread Jim Cushing
Despite the redundancy, having separate validators is nice since it  
allows you to customize the error message. For example, you might  
want to say, "Please enter your age," "Age must be a valid number,"  
and, "You must be at least 13 years old to ride this ride."


On Oct 16, 2007, at 3:44 PM, stanlick wrote:



I am discovering that duplicate field validators in S2 are a royal  
pain in

the tucas!  Remember the good old days when we could say age field
depends="required,int"  Now we need to specify two entirely  
separate field
validators!  I realize a field input may not *necessarily* be  
required, but

once entered needs to be validated.  What about having validators like
intRequired instead of two different validators?  This way we could  
pick

from a smarter validator crop and let the magic happen there.

Scott
--
View this message in context: http://www.nabble.com/validator- 
shortcuts-idea-tf4636405.html#a13241115

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator does not validate!

2007-07-03 Thread Ramon Xuriguera i Albareda

I don't know exactly what the problem was. After spending lots of
hours in front of the computer it worked!

I think the problem had something to do with what you say or, probably
with the exception I define in the action mapping.

Anyway, thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator does not validate!

2007-06-30 Thread Tim B

"Ramon Xuriguera i Albareda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks but, it doesn't work either...
> Any other ideas?
>
I have worked with an earlier version of the Struts validator and found that
the failure mode when there was a syntax error in validation.xml  for a
particular field was that the field always passed validation (container was
OC4J) I'd suggest you  add the dtd reference to you validation.xml  and
validate it somehow - one way is to use the Ant validate task.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator does not validate!

2007-06-30 Thread Paul Benedict

Can you repost relevant code and config with any corrections you made?

Ramon Xuriguera i Albareda wrote:

Thanks but, it doesn't work either...
Any other ideas?

2007/6/30, Dave Newton <[EMAIL PROTECTED]>:


Subclassing ValidationActionForm means that the form
"name" attribute in validation.xml would be the action
path, not the bean name. You want ValidationForm if
you want the validation form name to be the bean name.

...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator does not validate!

2007-06-30 Thread Ramon Xuriguera i Albareda

Thanks but, it doesn't work either...
Any other ideas?

2007/6/30, Dave Newton <[EMAIL PROTECTED]>:


Subclassing ValidationActionForm means that the form
"name" attribute in validation.xml would be the action
path, not the bean name. You want ValidationForm if
you want the validation form name to be the bean name.

...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator does not validate!

2007-06-29 Thread Dave Newton
--- Ramon Xuriguera i Albareda wrote:
> VALIDATION.XML
> 
>   
>
> FORMBEAN (SubjectForm.java)
> It extends ValidationActionForm 

Subclassing ValidationActionForm means that the form
"name" attribute in validation.xml would be the action
path, not the bean name. You want ValidationForm if
you want the validation form name to be the bean name.

See

http://struts.apache.org/1.x/apidocs/org/apache/struts/validator/ValidatorForm.html
http://struts.apache.org/1.x/apidocs/org/apache/struts/validator/ValidatorActionForm.html

d.



   

Moody friends. Drama queens. Your life? Nope! - their life, your story. Play 
Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Problem

2007-04-13 Thread Laurie Harper

Tom Bednarz wrote:

I use a form derived from ValidatorActionForm.

If the validator fires a message and redisplays the form, I loose my 
request params!


I do:



this actions opens a form with a request parameter op set to new.

inside this form I do something like:











.

If the user enters garbage in any field that is validated the form is 
redisplayed with an error message on the right side of the field.


BUT THE ${requestScope.op} is empty and therefore this information is 
LOST!! Any idea what I am doing wrong???


I would guess it has to do with how you're setting up the 'op' hidden 
input. you have name="op" property="op" value="..." which is telling 
Struts to use the 'op' property of a bean named 'op' in some scope. What 
does the generated HTML look like?


I would suggest:

a) move the hidden input outside the c:if tests, and just set it 
unconditionally;
b) simplify the html:hidden, or maybe use vanilla HTML instead of the 
custom action, since you don't need the extra functionality provided by 
html:hidden in this case.


The result would look like one of:




HTH,

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

Thanks Ted!  I felt a little queezy about using "requiredstring" but
couldn't get Eclipse to reveal a list of valid atrribute values with code
assist.

On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:


On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> what about simple type conversion? How will you ever have non-string
> coming from html? Does this mean we are back to domain object with
> only strings?

No, it means that we have a special validator for Strings to cover
both the notion of being null and the notion of being empty, and
optionally trimming it first.

* http://struts.apache.org/2.x/docs/required-validator.html

* http://struts.apache.org/2.x/docs/requiredstring-validator.html

- 
+ 

-Ted.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Validator Issue

2007-03-23 Thread Ted Husted

On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

what about simple type conversion? How will you ever have non-string
coming from html? Does this mean we are back to domain object with
only strings?


No, it means that we have a special validator for Strings to cover
both the notion of being null and the notion of being empty, and
optionally trimming it first.

* http://struts.apache.org/2.x/docs/required-validator.html

* http://struts.apache.org/2.x/docs/requiredstring-validator.html

- 
+ 

-Ted.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
> what about simple type conversion? How will you ever
> have non-string coming from html? Does this mean we 
> are back to domain object with only strings?

S2 (and others) already do simple type conversion.

You will "never" have non-strings coming from the
*browser* because that's how HTTP works.

You already *had* a domain object with non-strings,
but were using a *string* validator to check it,
which obviously won't work.

I wrote:
>> So create a Zipcode datatype that allows for +4,
>> use a regex or type-specific validator and a 
>> converter, and you have your "rich" domain model. 
>> Putting a zipcode in an integer is not a good idea,

>> even if it *is* just for the US.

I would imagine you could just as easily validate
your converted Zipcode datatype, even doing a lookup
if you really wanted.

But you *still* don't want a zipcode to be an
*integer*.

d.



 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

what about simple type conversion? How will you ever have non-string
coming from html? Does this mean we are back to domain object with
only strings?

On 3/23/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- [EMAIL PROTECTED] wrote:
> Are you suggesting that we *ARE* back to needing
> *DUMB* strings in our *RICH* domain models?  I
> thought the tired old FormBean was a thing of the
> past!

That's backwards. You were testing an int with a
String test and it failed *because* it wasn't viewing
everything as a string.

So create a Zipcode datatype that allows for +4, use a
regex or type-specific validator and a converter, and
you have your "rich" domain model. Putting a zipcode
in an integer is not a good idea, even if it *is* just
for the US.

d.





Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
> Are you suggesting that we *ARE* back to needing
> *DUMB* strings in our *RICH* domain models?  I 
> thought the tired old FormBean was a thing of the
> past!

That's backwards. You were testing an int with a
String test and it failed *because* it wasn't viewing
everything as a string.

So create a Zipcode datatype that allows for +4, use a
regex or type-specific validator and a converter, and
you have your "rich" domain model. Putting a zipcode
in an integer is not a good idea, even if it *is* just
for the US.

d.



 

Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread Ted Husted

There's a different validator for numeric types.

*  http://struts.apache.org/2.x/docs/required-validator.html

On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Oh!  It is an int.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

Are you suggesting that we *ARE* back to needing *DUMB* strings in our
*RICH* domain models?  I thought the tired old FormBean was a thing of the
past!

On 3/23/07, Dave Newton <[EMAIL PROTECTED]> wrote:


--- [EMAIL PROTECTED] wrote:
> Oh!  It is an int.

That could cause a problem :)

Probably not a good idea anyway, since you may want to
enforce either Zip or Zip+4 and not let people enter
"145".

d.






8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Validator Issue

2007-03-23 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
> Oh!  It is an int.

That could cause a problem :)

Probably not a good idea anyway, since you may want to
enforce either Zip or Zip+4 and not let people enter
"145".

d.



 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

Oh!  It is an int.

Scott

On 3/23/07, Dave Newton <[EMAIL PROTECTED]> wrote:


--- [EMAIL PROTECTED] wrote:
> What do you mean by target type?

What (Java) type is the value you are validating?

>
> On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:
> >
> > Is the target type a String?
> >
> > On 3/23/07, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > > Actually, I removed the js attributes and it
> behaved the same.
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
>
>
> --
> Scott
> [EMAIL PROTECTED]
>






Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Validator Issue

2007-03-23 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
> What do you mean by target type?

What (Java) type is the value you are validating?

> 
> On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:
> >
> > Is the target type a String?
> >
> > On 3/23/07, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > > Actually, I removed the js attributes and it
> behaved the same.
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> Scott
> [EMAIL PROTECTED]
> 



 

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

What do you mean by target type?

On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:


Is the target type a String?

On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Actually, I removed the js attributes and it behaved the same.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Validator Issue

2007-03-23 Thread Ted Husted

Is the target type a String?

On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Actually, I removed the js attributes and it behaved the same.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

Actually, I removed the js attributes and it behaved the same.

On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:


What happens if the custom JavaScripts are not used, but the
validation element is used?

If the JavaScript seems to be culprit, then I'd use FireBug or
something to watch the request, to see if there is something funky
going on there. The server-side can only handle what it receives.

-Ted.

On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Server side.
>
> On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:
> >
> > Is it the server-side or client-side validation that is firing when it
> > should not?
> >
> > If it is the client-side, and the custom scripts are based on
> > Prototype, there could be DOM-related issues, since Prototype rewrites
> > the DOM.
> >
> > -Ted.
> >
> > On 3/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > I have this field on a web page:
> > >
> > >  > > size="10" onblur="zipChanged(this.value
> > );"onfocus="clearCityAndStateFields();"
> > > />
> > >
> > > and this validator configured for it:
> > >
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > The only way I can pass the "Zip Code is required" validation is to
> > remove the
> > > validator entry.  All the other fields on the page work
> > > fine with their validators.  Is there some issue with
Javscript?  This
> > is
> > > the only field wired to script.
> > >
> > > --
> > > Scott
> > > [EMAIL PROTECTED]
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Scott
> [EMAIL PROTECTED]
>


--
HTH, Ted 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Validator Issue

2007-03-23 Thread Ted Husted

What happens if the custom JavaScripts are not used, but the
validation element is used?

If the JavaScript seems to be culprit, then I'd use FireBug or
something to watch the request, to see if there is something funky
going on there. The server-side can only handle what it receives.

-Ted.

On 3/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Server side.

On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:
>
> Is it the server-side or client-side validation that is firing when it
> should not?
>
> If it is the client-side, and the custom scripts are based on
> Prototype, there could be DOM-related issues, since Prototype rewrites
> the DOM.
>
> -Ted.
>
> On 3/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > I have this field on a web page:
> >
> >  > size="10" onblur="zipChanged(this.value
> );"onfocus="clearCityAndStateFields();"
> > />
> >
> > and this validator configured for it:
> >
> > 
> > 
> > 
> > 
> > 
> >
> > The only way I can pass the "Zip Code is required" validation is to
> remove the
> > validator entry.  All the other fields on the page work
> > fine with their validators.  Is there some issue with Javscript?  This
> is
> > the only field wired to script.
> >
> > --
> > Scott
> > [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Scott
[EMAIL PROTECTED]




--
HTH, Ted 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Issue

2007-03-23 Thread stanlick

Server side.

On 3/23/07, Ted Husted <[EMAIL PROTECTED]> wrote:


Is it the server-side or client-side validation that is firing when it
should not?

If it is the client-side, and the custom scripts are based on
Prototype, there could be DOM-related issues, since Prototype rewrites
the DOM.

-Ted.

On 3/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have this field on a web page:
>
>  size="10" onblur="zipChanged(this.value
);"onfocus="clearCityAndStateFields();"
> />
>
> and this validator configured for it:
>
> 
> 
> 
> 
> 
>
> The only way I can pass the "Zip Code is required" validation is to
remove the
> validator entry.  All the other fields on the page work
> fine with their validators.  Is there some issue with Javscript?  This
is
> the only field wired to script.
>
> --
> Scott
> [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Validator Issue

2007-03-23 Thread Ted Husted

Is it the server-side or client-side validation that is firing when it
should not?

If it is the client-side, and the custom scripts are based on
Prototype, there could be DOM-related issues, since Prototype rewrites
the DOM.

-Ted.

On 3/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I have this field on a web page:



and this validator configured for it:







The only way I can pass the "Zip Code is required" validation is to remove the
validator entry.  All the other fields on the page work
fine with their validators.  Is there some issue with Javscript?  This is
the only field wired to script.

--
Scott
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator question Struts 1.2.9

2007-03-21 Thread Dilip Ladhani

Thanks, I figured it out. I made sure this was by default bundle.

On 3/21/07, Niall Pemberton <[EMAIL PROTECTED]> wrote:

On 3/21/07, Dilip Ladhani <[EMAIL PROTECTED]> wrote:
> I have gotten the validator to work in may of my projects, but I am
> stuck on this one and was wondering if someone can help.
> I have a MessageResources.properties under WEB-INF/classes which
> contains all the messages.
> In my struts-config I have the following line
> 
> Here is my validation.xml
> 
>  property="selectedCategory"
> depends="required">
> 
> 
>  property="startDate"
> depends="required,date">
> 
> 
> datePattern
> MM/dd/
>   
> 
> 
> I also tried putting 
> I always get an exception when I validate. I call the form.validate
> from my action class, I always get the following exception

If you're not using the "default" bundle then you need to specify the
bundle for all the messages as well - so you would have to add 
elements for both the "required" and "date" validator in the above
example (with the "bundle" attribute specified).

Niall

> 2007-03-21 12:41:36,437] [location -
> 
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:578)]
> Unhandled exception thrown during validation: No message resources
> found for bundle: org.apache.struts.action.MESSAGE
> java.lang.NullPointerException: No message resources found for bundle:
> org.apache.struts.action.MESSAGE
> at 
org.apache.struts.validator.Resources.getMessageResources(Resources.java:140)
> at 
org.apache.struts.validator.Resources.getActionMessage(Resources.java:349)
> at 
org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:94)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
>
> thanks
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator question Struts 1.2.9

2007-03-21 Thread Niall Pemberton

On 3/21/07, Dilip Ladhani <[EMAIL PROTECTED]> wrote:

Thanks for the reply.
However, after doing that I get the error
Unhandled exception thrown during validation: No message resources
found for bundle: messages
java.lang.NullPointerException: No message resources found for bundle: messages


OK after making it the default - did you remove the bundle="messages"
from your validation.xml?

Also take a look at the "bundles" example in the validator part of the
struts-examples webapp shipped with Struts 1.2.9

Niall


Also, on various jsps, I would have to, I would have to remove
bundle="messages", for eg

This I can do, however, I still get the above error

On 3/21/07, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:
> make your message resource as the defautl one, dont put any key just add the
> entry
> 
>
> in struts-config and see.,
>
> Thanks & Regards,
>
> Nuwan.
>
>
>
> - Original Message -
> From: "Dilip Ladhani" <[EMAIL PROTECTED]>
> To: 
> Sent: Wednesday, March 21, 2007 4:48 PM
> Subject: Validator question Struts 1.2.9
>
>
> >I have gotten the validator to work in may of my projects, but I am
> > stuck on this one and was wondering if someone can help.
> > I have a MessageResources.properties under WEB-INF/classes which
> > contains all the messages.
> > In my struts-config I have the following line
> > 
> > Here is my validation.xml
> >
> > >property="selectedCategory"
> >depends="required">
> >
> >
> > >property="startDate"
> >depends="required,date">
> >
> >
> >datePattern
> >MM/dd/
> >  
> >
> >
> > I also tried putting 
> > I always get an exception when I validate. I call the form.validate
> > from my action class, I always get the following exception
> >
> > 2007-03-21 12:41:36,437] [location -
> > 
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:578)]
> > Unhandled exception thrown during validation: No message resources
> > found for bundle: org.apache.struts.action.MESSAGE
> > java.lang.NullPointerException: No message resources found for bundle:
> > org.apache.struts.action.MESSAGE
> > at
> > 
org.apache.struts.validator.Resources.getMessageResources(Resources.java:140)
> > at
> > org.apache.struts.validator.Resources.getActionMessage(Resources.java:349)
> > at
> > 
org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:94)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> > 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > at
> > 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:585)
> >
> > thanks
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator question Struts 1.2.9

2007-03-21 Thread Niall Pemberton

On 3/21/07, Dilip Ladhani <[EMAIL PROTECTED]> wrote:

I have gotten the validator to work in may of my projects, but I am
stuck on this one and was wondering if someone can help.
I have a MessageResources.properties under WEB-INF/classes which
contains all the messages.
In my struts-config I have the following line

Here is my validation.xml







datePattern
MM/dd/
  


I also tried putting 
I always get an exception when I validate. I call the form.validate
from my action class, I always get the following exception


If you're not using the "default" bundle then you need to specify the
bundle for all the messages as well - so you would have to add 
elements for both the "required" and "date" validator in the above
example (with the "bundle" attribute specified).

Niall


2007-03-21 12:41:36,437] [location -
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:578)]
Unhandled exception thrown during validation: No message resources
found for bundle: org.apache.struts.action.MESSAGE
java.lang.NullPointerException: No message resources found for bundle:
org.apache.struts.action.MESSAGE
at 
org.apache.struts.validator.Resources.getMessageResources(Resources.java:140)
at 
org.apache.struts.validator.Resources.getActionMessage(Resources.java:349)
at 
org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)

thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator question Struts 1.2.9

2007-03-21 Thread Dilip Ladhani

Thanks for the reply.
However, after doing that I get the error
Unhandled exception thrown during validation: No message resources
found for bundle: messages
java.lang.NullPointerException: No message resources found for bundle: messages

Also, on various jsps, I would have to, I would have to remove
bundle="messages", for eg

This I can do, however, I still get the above error

On 3/21/07, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:

make your message resource as the defautl one, dont put any key just add the
entry


in struts-config and see.,

Thanks & Regards,

Nuwan.



- Original Message -
From: "Dilip Ladhani" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, March 21, 2007 4:48 PM
Subject: Validator question Struts 1.2.9


>I have gotten the validator to work in may of my projects, but I am
> stuck on this one and was wondering if someone can help.
> I have a MessageResources.properties under WEB-INF/classes which
> contains all the messages.
> In my struts-config I have the following line
> 
> Here is my validation.xml
>
>property="selectedCategory"
>depends="required">
>
>
>property="startDate"
>depends="required,date">
>
>
>datePattern
>MM/dd/
>  
>
>
> I also tried putting 
> I always get an exception when I validate. I call the form.validate
> from my action class, I always get the following exception
>
> 2007-03-21 12:41:36,437] [location -
> 
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:578)]
> Unhandled exception thrown during validation: No message resources
> found for bundle: org.apache.struts.action.MESSAGE
> java.lang.NullPointerException: No message resources found for bundle:
> org.apache.struts.action.MESSAGE
> at
> org.apache.struts.validator.Resources.getMessageResources(Resources.java:140)
> at
> org.apache.struts.validator.Resources.getActionMessage(Resources.java:349)
> at
> org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:94)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
>
> thanks
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator question Struts 1.2.9

2007-03-21 Thread Nuwan Chandrasoma
make your message resource as the defautl one, dont put any key just add the 
entry



in struts-config and see.,

Thanks & Regards,

Nuwan.



- Original Message - 
From: "Dilip Ladhani" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, March 21, 2007 4:48 PM
Subject: Validator question Struts 1.2.9



I have gotten the validator to work in may of my projects, but I am
stuck on this one and was wondering if someone can help.
I have a MessageResources.properties under WEB-INF/classes which
contains all the messages.
In my struts-config I have the following line

Here is my validation.xml
   
   
   
   
   
   
   
   datePattern
   MM/dd/
 
   
   
I also tried putting 
I always get an exception when I validate. I call the form.validate
from my action class, I always get the following exception

2007-03-21 12:41:36,437] [location -
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:578)]
Unhandled exception thrown during validation: No message resources
found for bundle: org.apache.struts.action.MESSAGE
java.lang.NullPointerException: No message resources found for bundle:
org.apache.struts.action.MESSAGE
at 
org.apache.struts.validator.Resources.getMessageResources(Resources.java:140)
at 
org.apache.struts.validator.Resources.getActionMessage(Resources.java:349)
at 
org.apache.struts.validator.FieldChecks.validateRequired(FieldChecks.java:94)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator validWhen

2007-03-01 Thread Niall Pemberton

On 2/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Thank you for your reply.

Why is it only server-side ?


Because no-one has written the equivalent functionality in JavaScript.
Validwhen uses antlr to evaluate expressions on the server side -
replicating its functionality in JavaScript would be probably be
difficult. I think if you were looking to provide that kind of
validation for both client and server side then it would be easier to
start afresh and not use antlr.

Niall

[1] http://www.antlr.org/


Regards,


Selon Niall Pemberton <[EMAIL PROTECTED]>:

> No its server-side only.
>
> Niall
>
> On 2/27/07, jmpdev <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I would like to know if it is possible to call validWhen on the client
> > side?
> >
> > I didn't find validWhen.js is it possible to find it somewhere?
> >
> > Thanks,
> >
> > Regards, Jean-Marie.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator validWhen

2007-02-28 Thread jmpdev

Thank you for your reply.

Why is it only server-side ?

Regards,


Selon Niall Pemberton <[EMAIL PROTECTED]>:

> No its server-side only.
>
> Niall
>
> On 2/27/07, jmpdev <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I would like to know if it is possible to call validWhen on the client
> > side?
> >
> > I didn't find validWhen.js is it possible to find it somewhere?
> >
> > Thanks,
> >
> > Regards, Jean-Marie.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator validWhen

2007-02-27 Thread Niall Pemberton

No its server-side only.

Niall

On 2/27/07, jmpdev <[EMAIL PROTECTED]> wrote:

Hi,

I would like to know if it is possible to call validWhen on the client
side?

I didn't find validWhen.js is it possible to find it somewhere?

Thanks,

Regards, Jean-Marie.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator question

2007-02-27 Thread Laurie Harper

Tom Bednarz wrote:
I have a FormBean derived from ValidatorActionForm. I define validation 
rules for certain properties in validation.xml.


No I like to add some additional validations which depend on user input. 
I thought, I can handle this in the validate(..) method but it gets 
never called!


I implemented something like:

public class QueryTripsForm extends ValidatorActionForm
{
   ...
   public ActionErrors validate(ActionMapping mapping,
javax.servlet.ServletRequest request)
   {
ActionErrors e = null;
super.validate(mapping, request);
// doing some special checks here
// ..   
return e;

   }
   
}


That looks OK. Are you sure you want to extend ValidatorActionForm 
rather than just ValidatorForm? The effect is subtly different. You 
haven't posted your validation config, so I can't tell which would be 
correct for your useage.


Why is this validate method never called? (validate is set to true, see 
below)



  



How is the form declared in struts-config.xml? What URL are you 
accessing? Assuming your form is declared with the name 'queryTripsForm' 
and you're actually hitting this action mapping, validate() should be 
getting called I think.


Is there any way to combile 'default' validations defined in 
validation.xml with additional validations implemented in the validate() 
method??


Yes, with a slight correction to your code above:

ActionErrors e = super.validate(mapping, request);

You need to capture the errors from the 'default' validation process or 
they'll be discarded.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator error what does this mean?

2007-01-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas,

Hehl, Thomas wrote:
> I'm still pretty new to struts and am taking over an app from a previous
> developer. I have added some validation and got the following error:
> 
> ValidWhen Error for field ' additionalInfo' - line 1:18: unexpected token: )
> 
> Here is the code from Validator-defaults.xml
> 
>  
>   
>   
>   
>   
>   
> 
>   test
>   ((remarksRequired) or (*this* != null))
> 
> 
> 

The expression language for "validwhen" tests is very limited. The
sub-expression (remarksRequired) is invalid because there is no
comparison. I assume that you want something like this:

((remarksRequired == 'true') or (*this* != null))

If you want to compare "remarksRequired" to a specific value, you should
do so as indicated above. If you only want to test for it's existence,
then you can use "remarksRequired != null".

Hope that helps,
- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFFms2m9CaO5/Lv0PARAv9DAJd41+fXz/F4Srg03s4Ru96eowesAKCBMbsH
DoErYaqB+xSlzbg44uObHA==
=fa3V
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validator Framework 1.29

2006-12-20 Thread nagesh.kumar
 




  


  

  





Use this
-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 21, 2006 9:16 AM
To: Struts Users Mailing List
Subject: Re: Validator Framework 1.29

On 12/20/06, Jim Reynolds <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am having some issues with getting the messages from the validator 
> framework from showing. Actually, I have some old code like this:
>   
>  
>
>  
>   
> that used to work, before upgrading to 1.29. I am getting this error:
> "ccording to TLD or attribute directive in tag file, attribute value 
> does not accept any expressions" (I posted this earlier with no 
> response).

So its objecting to a run time expression in your  tag - thats JSTL
not Struts or validator - but I don't think you need it anyway, can't you
just use

or


> Then I am reading through Struts in Action book and they show this 
> type of error handling in the jsp page.
>
>   
>  
>  
>  
> with a import of this tld.
> uri="/tags/struts-validator" prefix="validator" %>
>
> Anyway, now I am confused and not sure which is the best approach to 
> follow. Also, I cannot find the tld for struts-validator? I checked 
> the struts jar for a tld, but did not find one, and I checked the 
> commons-validator.jar and did not find it there. I don't mind using 
> second one from book, but where is tld?

There are no "validator" jsp tags in Struts or Commons Validator - so no TLD
to go with it.

Niall

> Thanks,

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Framework 1.29

2006-12-20 Thread Niall Pemberton

On 12/20/06, Jim Reynolds <[EMAIL PROTECTED]> wrote:

Hello,

I am having some issues with getting the messages from the validator
framework from showing. Actually, I have some old code like this:
  
 
   
 
  
that used to work, before upgrading to 1.29. I am getting this error:
"ccording to TLD or attribute directive in tag file, attribute value
does not accept any expressions" (I posted this earlier with no
response).


So its objecting to a run time expression in your  tag - thats
JSTL not Struts or validator - but I don't think you need it anyway,
can't you just use
   
or
   


Then I am reading through Struts in Action book and they show this
type of error handling in the jsp page.

  
 
 
 
with a import of this tld.
uri="/tags/struts-validator" prefix="validator" %>

Anyway, now I am confused and not sure which is the best approach to
follow. Also, I cannot find the tld for struts-validator? I checked
the struts jar for a tld, but did not find one, and I checked the
commons-validator.jar and did not find it there. I don't mind using
second one from book, but where is tld?


There are no "validator" jsp tags in Struts or Commons Validator - so
no TLD to go with it.

Niall


Thanks,


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator FrameWork

2006-12-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas,

Thomas Thomas wrote:
> Thank u,
> it works great :-)

No problem.

> I have :
> 
> 
> 
> May I ask u, dear Christopher, what's the difference of it with what u have
> done :
> 
>  key="error.unmatched.password.confirm" />
> 

I'm not sure what the difference is. Would you like me to compare this
to something specific?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFfWgJ9CaO5/Lv0PARAkTSAJ9qubORMvcm/wd4xQ/4gHn3uQSlCACfYx8g
NWEDhXN+jV+SSCjKqjiraXE=
=LcPQ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator - Date validation

2006-12-08 Thread Thomas Thomas

Ok everything is fixed, I forgot to do :

ValidatorUtils.getValueAsString


Re: Validator - Date validation

2006-12-08 Thread Thomas Thomas

I get the String literals and not the real numbers


Re: Validator - Date validation

2006-12-08 Thread Thomas Thomas

I make a custom validator myDate
I try to give as var value the day and the month,
but when I try to get the values of the vars day and month,
I get the String literals birthDay and birthMonth

   

   

   
   
   
 day
 birthDay
   
   
 month
 birthMonth
   
   


Re: Validator FrameWork

2006-12-08 Thread Thomas Thomas

Thank u,
it works great :-)

I have :



May I ask u, dear Christopher, what's the difference of it with what u have
done :





Re: Validator FrameWork

2006-12-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas,

Thomas Thomas wrote:
> (*this* == password)
> 
> But it still doesn't work

This is exactly what I have in my setup, and it works like a charm:

  




test

(
(password == null)
or
(*this* == password)
)


  

Make sure that your config file is being re-loaded. You will have to
reload the webapp in order to make that happen... changing the file will
not trigger a reload.

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFeJ929CaO5/Lv0PARAp7nAKCsGhwmlzurFklQmTLBH9cvgS85VgCgpqP5
hQ76T7r5u++UL5P4X8M1Q/Q=
=4/iJ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator FrameWork

2006-12-07 Thread Thomas Thomas

Instead of :

(passwordCheck == password)

I put :

(*this* == password)

But it still doesn't work


Re: Validator FrameWork

2006-12-07 Thread Thomas Thomas

Dear Sean,
thank u for your precious support.

I added this :
   
   
   
 test
 (passwordCheck == password)
   
   
But it's not working :-(


RE: Validator FrameWork

2006-12-07 Thread O'Shea, Sean
Use the validWhen validator for the password and the passwordCheck
fields: http://struts.apache.org/1.2.x/userGuide/dev_validator.html
You'll need to add the passwordCheck field to your registerForm.

I've found these links useful when investigating commons-validator:

*   commons validator examples:
http://wiki.apache.org/jakarta-commons/ValidatorExamples
*   Struts and commons-validator tutorial:
http://struts.apache.org/1.1/userGuide/dev_validator.html
*   Struts validation framework tutorial:
http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html
*   Oracle article on Struts validation framework:
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
*   Very simple Struts validation example:
http://wiki.apache.org/struts/StrutsBeginnerValidatorFramework?highlight
=%28validator%29
*   Helpful Struts validation site:
http://www.niallp.pwp.blueyonder.co.uk/
*   Validation of lists:
http://wiki.apache.org/struts/StrutsCatalogLazyList
*   Useful validator tip for extends:
http://wiki.apache.org/jakarta-commons/ValidatorVersion120

Sean

-Original Message-
From: Thomas Thomas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 07, 2006 3:05 PM
To: Struts Users Mailing List
Subject: Validator FrameWork

 Hi,
I'm using Validator Framework with Struts,
Here I want to validate a registration form.

I want to add a field property passwordCheck, (the user needs to enters
his
password twice : the first password will be in property password, the
second
in passwordCheck)
I want to check if value of password and passwordCheck are the same.
How can I do this ?
Thank u.
Here is my code from now on without the field property passwordCheck :

 
  
   
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 


(In addition to that, I have a lot of difficulties to find information
myself about validator framework, do u have any link for a full
documentation ?)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Framework problem

2006-11-30 Thread Niall Pemberton

On 11/28/06, Thomas Thomas <[EMAIL PROTECTED]> wrote:

Hi,
since I added a constraint for the length with minlength, I have the
following errror :

28-nov.-2006 21:31:33 org.apache.struts.validator.DynaValidatorForm validate
GRAVE: org.apache.struts.util.StrutsValidator
org.apache.commons.validator.ValidatorException:
org.apache.struts.util.StrutsValidator
at org.apache.commons.validator.ValidatorAction.loadValidationClass(
ValidatorAction.java:623)
at org.apache.commons.validator.ValidatorAction.executeValidationMethod(


The method signature in your validation class (i.e. StrutsValidator)
doesn't match up with what you have defined in the "methodParams"
element for your minlength validator.


I have the following code :
[...]

[...]






minlength
2


[...]


Also can u tell me what ${var:minlength} will display ?


It will use the value in the "minlength"  element (which is "2"
in your case) as the second argument for your minlength message - what
it will display will depend on the message you've set up in the
resource bundle for the minlength message (key errors.minlength in
your case).

Niall



I need to display a message in French.

Thank u for any help !




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Framework problem

2006-11-30 Thread Thomas Thomas

Nobody can help me ?
No-one has *Any* idea ?


RE: Validator without Struts

2006-11-30 Thread Saeed, Rada
U can use the nn-validation.js, have a look :
http://www.siteexperts.com/tips/functions/ts21/page10.asp 

-Original Message-
From: Jim Reynolds [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 30, 2006 12:22 AM
To: user@struts.apache.org
Subject: Validator without Struts

Hello,

I have the need to do some form validations, but the site in question is
not running Struts, nor WW or any framework. :-(

It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may be
able to work as a stand-alone entity.

I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?

Thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator without Struts

2006-11-29 Thread Niall Pemberton

On 11/29/06, Jim Reynolds <[EMAIL PROTECTED]> wrote:

Hello,

I have the need to do some form validations, but the site in question
is not running Struts, nor WW or any framework. :-(

It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may
be able to work as a stand-alone entity.

I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?


You can use Validator outside Struts, although I haven't actually used
the "framework" side of validator in that way. If it was just
"validation routines" you wanted, rather than the framework side then
Commons Validator has this:
   http://tinyurl.com/eahub

If you want to use the framework side then theres info here:
  http://tinyurl.com/ymrjy2
  http://wiki.apache.org/jakarta-commons/Validator

Theres also an example in the source distro, but you'll have to use
ant to build it yourself
  http://wiki.apache.org/jakarta-commons/ValidatorStandalone

Also its worth taking a look at the validator tests (in the source
distro) as they pretty much do "standalone validator".

Niall


Thanks


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator without Struts

2006-11-29 Thread Jon Wilmoth
You can try http://jakarta.apache.org/commons/validator/ which is commonly used 
w/Struts 1.


- Original Message 
From: Jim Reynolds <[EMAIL PROTECTED]>
To: user@struts.apache.org
Sent: Wednesday, November 29, 2006 2:21:49 PM
Subject: Validator without Struts


Hello,

I have the need to do some form validations, but the site in question
is not running Struts, nor WW or any framework. :-(

It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may
be able to work as a stand-alone entity.

I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?

Thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: validator framework

2006-10-23 Thread Laurie Harper

Yariel Ramos Moreno wrote:

How can I validate a form field to accept numbers from 1 to 99 or an underscore 
(_) using the validator framework. The application is in Struts 1.1.


If you didn't have the requirement to accept underscore, intRange would 
be what you were looking for. With that requirement, you'd have to use a 
regex, or write a custom validation rule. See the 'mask' validation rule 
[1] for the regex approach.


L.

[1] http://struts.apache.org/1.2.9/userGuide/dev_validator.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator framework

2006-10-20 Thread Sócrates Medina

Check this document,  slide 30 by Shang Shin.
http://www.javapassion.com/j2ee/StrutsValidationFramework_speakernoted.pdf

I think it's a good explanation...Check it out. Check intRange key, how he
works with it.

For dominicans, cubans are our brothers...we share historical events!

I hope this could help you.





On 10/20/06, Yariel Ramos Moreno <[EMAIL PROTECTED]> wrote:


Hi,

How can I validate a form field to accept numbers from 1 to 99 or an
underscore (_) using the validator framework. The application is in Struts
1.1.

Best Regards.
__

XIII Convención Científica de Ingeniería y Arquitectura
28/noviembre al 1/diciembre de 2006
Cujae, Ciudad de la Habana, Cuba
http://www.cujae.edu.cu/eventos/convencion





--


--

Sócrates Medina

--
-"Looking ahead!"


Re: Validator framework javascript error messages

2006-10-16 Thread Laurie Harper

Puneet Lakhina wrote:

Hi,
I have the following key value pair in ApplicationResource.properties

required = {0} is required.

I used this when I was doing only server side validation, to display a list
of error messages when some validation failed.

Now Im using the  to do the same thing on client side 
also.

But my problem is that now i get error messages like
Name is required
Status is requried

in an alert box on the jsp page when i submit with some validation 
errors. I

would like to maybe use different error messages for what is displayed on
the client side. Is that possible??
Following is my validation.xml





 
   
   
 
 
   
   
 




Im using struts 1.1


AFAIK, there's no way to use different validation messages client-side 
and server-side. However, what you should be able to do is remove the 
markup from the error messages you have, and use the server-side error 
reporting tags to insert it.


How you achieve the server-side part of that depends on how you display 
your error messages. If you use html:errors, you can use the 
errors.header, errors.footer, errors.prefix and errors.suffix resources 
[1]. If you use the html:messages tag [2], you would put the markup 
directly into your JSP / view.


L.

[1] http://struts.apache.org/1.2.9/userGuide/struts-html.html#errors
[2] http://struts.apache.org/1.2.9/userGuide/struts-html.html#messages


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator and At Least 1 Checkbox Checked

2006-09-20 Thread Paul Benedict
Laurie, absolutely, use the required validation. I do that for my 
applications. Since he was specifically talking about length of an 
array, there is no such validation; but as long as a valid is present, 
it was submitted.


Laurie Harper wrote:
Can't you just use the 'required' validation rule? Or possibly a 
validwhen with something like *this* != null and *tihs*.length >= 1? 
Admittedly I haven't tried either, though.


L.

Paul Benedict wrote:
I've always wanted this feature myself. However, no such validation 
exists.. but if you write it, you could share it back to the Struts 
community.


So you'll have to add this validation yourself by override the 
validate() method of your form, checking the property's length; if it 
is not null then add your message to the existing error messages.


Paul

Mississippi John Hurt wrote:

Can struts validator validate that at least one checkbox in a set is
checked?  I guess somehow it has to validate that a String[] array 
property

of the form has size of 1 or more, but I dont know how.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator and At Least 1 Checkbox Checked

2006-09-20 Thread Laurie Harper
Can't you just use the 'required' validation rule? Or possibly a 
validwhen with something like *this* != null and *tihs*.length >= 1? 
Admittedly I haven't tried either, though.


L.

Paul Benedict wrote:
I've always wanted this feature myself. However, no such validation 
exists.. but if you write it, you could share it back to the Struts 
community.


So you'll have to add this validation yourself by override the 
validate() method of your form, checking the property's length; if it is 
not null then add your message to the existing error messages.


Paul

Mississippi John Hurt wrote:

Can struts validator validate that at least one checkbox in a set is
checked?  I guess somehow it has to validate that a String[] array 
property

of the form has size of 1 or more, but I dont know how.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator and At Least 1 Checkbox Checked

2006-09-19 Thread Paul Benedict
I've always wanted this feature myself. However, no such validation 
exists.. but if you write it, you could share it back to the Struts 
community.


So you'll have to add this validation yourself by override the 
validate() method of your form, checking the property's length; if it is 
not null then add your message to the existing error messages.


Paul

Mississippi John Hurt wrote:

Can struts validator validate that at least one checkbox in a set is
checked?  I guess somehow it has to validate that a String[] array property
of the form has size of 1 or more, but I dont know how.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator FRamework

2006-09-07 Thread Laurie Harper

sheetal wrote:

Thanks for the help..
Yesterday I tried and it worked...
But the problem now is that its message string is not coming...
I had made an  entry for it in applicationresoUrces.properties...
BUT STILL IT'S UNABLE TO PICK IT FROM THERE..


What message string? How are you specifying it? How did you define it in 
your ApplictionResources.properties file? Did you deploy the resources? 
Are they configured correctly in struts-config.xml?


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator framework

2006-09-07 Thread Laurie Harper

Gomathi wrote:

Hai,
Is the validator framework is only for dynavalidatorform?
 I am using actionform using validator framework.Its not working fine how?


You need to derive your form beans from ValidatorActionForm, not just 
ActionForm. DynaValidatorForm extends ValidatorForm, so that should be 
OK, but if you have custom form beans extending ActionForm you'll need 
to change them to extend ValidatorForm instead.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator FRamework

2006-09-05 Thread sheetal

Laurie Harper wrote:

sheetal wrote:

Hi All,
I had problem..
I am trying to implement client side validation  using Validator  
FRamework.
I have added validator-rules.xml,  and validation.xml, in my web -inf 
file.

And made following entry in validation.xml


   

   

   



i have also added added an entry in struts config.xml.

 
 
   type="com.hns.nme.frontend.apps.cmdexecution.form.SelectCommandForm" />
   type="com.hns.nme.frontend.apps.cmdexecution.form.RunCommandForm" />

   

 
 
 

type="com.hns.nme.frontend.apps.cmdexecution.action.SelectCommandAction"

 scope="request">
 
 
   
  
type="com.hns.nme.frontend.apps.cmdexecution.action.RunCommandAction"

 input="/JSP/RunCommand.jsp"
 attribute="runCommandForm"
 name="runCommandForm"
 scope="request">
 
 
   


 parameter="com.hns.nme.frontend.apps.cmdexecution.ApplicationResources" 
/>


 
   
   
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>

   



Extended my form class  from ValidatorActionForm.
AND iN JSP PAGE i HAVE ADDED

also..

Still it's not working..



Not working how? Does validation fail completely, or only on the 
client? It looks like you may have a mis-match between your form bean 
base class and the way you've specified the validation rules; 
ValidatorActionForm validates based on the action mapping path, not 
the form name. So, you either need to change your validation.xml to 
something like this:


  or switch your form beans to be derived from ValidatorForm instead of 
ValidatorActionForm.


If server-side validation is working and it's just client-side 
validation that's not, do you have the html:javascript tag somewhere 
in your page?


L.



Thanks for the help..
Yesterday I tried and it worked...
But the problem now is that its message string is not coming...
I had made an  entry for it in applicationresoUrces.properties...
BUT STILL IT'S UNABLE TO PICK IT FROM THERE..
REGARDS,
Sheetal



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator FRamework

2006-09-05 Thread Laurie Harper

sheetal wrote:

Hi All,
I had problem..
I am trying to implement client side validation  using Validator  
FRamework.

I have added validator-rules.xml,  and validation.xml, in my web -inf file.
And made following entry in validation.xml


   

   

   



i have also added added an entry in struts config.xml.

 
 
   type="com.hns.nme.frontend.apps.cmdexecution.form.SelectCommandForm" />
   type="com.hns.nme.frontend.apps.cmdexecution.form.RunCommandForm" />

   

 
 
 

type="com.hns.nme.frontend.apps.cmdexecution.action.SelectCommandAction"

 scope="request">
 
 
   
 
 
 
   


 parameter="com.hns.nme.frontend.apps.cmdexecution.ApplicationResources" />


 
   
   
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>

   



Extended my form class  from ValidatorActionForm.
AND iN JSP PAGE i HAVE ADDED

also..

Still it's not working..



Not working how? Does validation fail completely, or only on the client? 
It looks like you may have a mis-match between your form bean base class 
and the way you've specified the validation rules; ValidatorActionForm 
validates based on the action mapping path, not the form name. So, you 
either need to change your validation.xml to something like this:


  or switch your form beans to be derived from ValidatorForm instead of 
ValidatorActionForm.


If server-side validation is working and it's just client-side 
validation that's not, do you have the html:javascript tag somewhere in 
your page?


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator FRamework

2006-09-05 Thread Jorge Martín Cuervo
ups, sorry i thought you were using dinaform

sorry

El mar, 05 de 09 de 2006 a las 13:13, Jorge Martín Cuervo escribió:

> hi
> 
> why you use
> com.hns.nme.frontend.apps.cmdexecution.form.SelectCommandForm instead
> java.lang.String in form-bean type?
> 
> El mar, 05 de 09 de 2006 a las 10:48, sheetal escribió:
> 
> > Hi All,
> > I had problem..
> > I am trying to implement client side validation  using Validator  FRamework.
> > I have added validator-rules.xml,  and validation.xml, in my web -inf file.
> > And made following entry in validation.xml
> > 
> > 
> > 
> > 
> >  > depends="required">
> >  
> > 
> >   
> > 
> > 
> >   
> > 
> > i have also added added an entry in struts config.xml.
> > 
> >   
> >   
> >  > type="com.hns.nme.frontend.apps.cmdexecution.form.SelectCommandForm" />
> >  > type="com.hns.nme.frontend.apps.cmdexecution.form.RunCommandForm" />
> > 
> > 
> >   
> >   
> >   
> >  >   
> > type="com.hns.nme.frontend.apps.cmdexecution.action.SelectCommandAction"
> >   scope="request">
> >   
> >   
> > 
> >
> >  >   type="com.hns.nme.frontend.apps.cmdexecution.action.RunCommandAction"
> >   input="/JSP/RunCommand.jsp"
> >   attribute="runCommandForm"
> >   name="runCommandForm"
> >   scope="request">
> >   
> >   
> > 
> >
> >
> > 
> >> parameter="com.hns.nme.frontend.apps.cmdexecution.ApplicationResources" />
> >  
> >   
> > 
> >>
> > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> > 
> >  
> > 
> > 
> > Extended my form class  from ValidatorActionForm.
> > AND iN JSP PAGE i HAVE ADDED
> >  > also..
> > 
> > Still it's not working..
> > 
> > Can anybody help  me out..
> > 
> > 
> > Thanks
> > 
> > Regards,
> > Sheetal
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 

-- 
;-)

Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email <[EMAIL PROTECTED]>
voz +34 985 129 820
voz +34 660 026 384



Re: Validator FRamework

2006-09-05 Thread Jorge Martín Cuervo
hi

why you use
com.hns.nme.frontend.apps.cmdexecution.form.SelectCommandForm instead
java.lang.String in form-bean type?

El mar, 05 de 09 de 2006 a las 10:48, sheetal escribió:

> Hi All,
> I had problem..
> I am trying to implement client side validation  using Validator  FRamework.
> I have added validator-rules.xml,  and validation.xml, in my web -inf file.
> And made following entry in validation.xml
> 
> 
> 
> 
>  depends="required">
>  
> 
>   
> 
> 
>   
> 
> i have also added added an entry in struts config.xml.
> 
>   
>   
>  type="com.hns.nme.frontend.apps.cmdexecution.form.SelectCommandForm" />
>  type="com.hns.nme.frontend.apps.cmdexecution.form.RunCommandForm" />
> 
> 
>   
>   
>   
>
> type="com.hns.nme.frontend.apps.cmdexecution.action.SelectCommandAction"
>   scope="request">
>   
>   
> 
>
>type="com.hns.nme.frontend.apps.cmdexecution.action.RunCommandAction"
>   input="/JSP/RunCommand.jsp"
>   attribute="runCommandForm"
>   name="runCommandForm"
>   scope="request">
>   
>   
> 
>
>
> 
>parameter="com.hns.nme.frontend.apps.cmdexecution.ApplicationResources" />
>  
>   
> 
>   
> value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> 
>  
> 
> 
> Extended my form class  from ValidatorActionForm.
> AND iN JSP PAGE i HAVE ADDED
>  also..
> 
> Still it's not working..
> 
> Can anybody help  me out..
> 
> 
> Thanks
> 
> Regards,
> Sheetal
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
;-)

Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email <[EMAIL PROTECTED]>
voz +34 985 129 820
voz +34 660 026 384



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz

Thanks a lot for all that feedback. I think it gets me a step further.

Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Wendy Smoak

On 8/30/06, Tom Bednarz <[EMAIL PROTECTED]> wrote:


What is the correct or preferred way to link business-objects with form
beans. Is this only possible by copying data from a business object to a
form bean or is there any 'smarter' way?


You might want to take a look at FormDef: https://formdef.dev.java.net/

--
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread David Durham

Tom Bednarz wrote:

So I used



Don't specify value.  Simply copy the properties from a subscriber 
object (session scoped or otherwise) to a formbean (the one being used 
to render the form values).  There's a copyProperties method in 
org.apache.commons.beanutils.BeanUtils:


  http://tinyurl.com/zp6ag

Also, the Spring Framework has a copyProperties method in one of its 
utility classes.  It has the advantage of not throwing a checked 
exception and its parameter ordering makes more sense to some (myself 
included).


A reason to not specify a value for html:text, at the view level, is 
that it overwrites the value in an associated form-bean object.  This 
could lead to overwriting user input or overwriting data that was 
populated from an Action.


It may be acceptable to specify value on a checkbox, for instance, 
because user's don't typically interact with this value directly. 
Still, if a value for a checkbox, like any other form control, was set 
in a controller class, then a page level value will overwrite data.  At 
the very least, this is counterintuitive.  More often, it is incorrect.



-Dave

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz
Thanks a lot for all your input and help. It looks like I need some 
basic concepts clarified. Here a very short background of the 
application and what my intension is:


The object 'subscriber' is a special business object: it represents the 
logged in user and contains a lot of information about him: Personal 
data like name, address, e-mail, preferred language etc. But it contains 
also information about his roles, type of subsciption he bought etc. 
Shortly I need parts of this information almost everywhere in the 
application and thats why the thing sits in session scope.


The action we were discussing 'changePersonalDataForm' represents a form 
where the user can change some of this informations such as personal 
data, language etc. Other things such as roles, subscibtion information 
etc are not visible to the user. The object has logic to retrieve its 
information from various database tables and also store information back 
if there are changes. This is performed exclusively in this object not 
in any action. The object is created and filled when the user has 
successfully logged in.


So I used 




to initially fill the firstname directly from the business object into 
the form. If the user submits the form the information is updated in the 
object and also written back to the DB server. Nice things like 
ChangeEventListeners as available in Swing and also in JSF are sort of 
missing in Struts (at least I did not find something alike)


So the key question seems to be:

What is the correct or preferred way to link business-objects with form 
beans. Is this only possible by copying data from a business object to a 
form bean or is there any 'smarter' way? Copying ends up in writing a 
lot of copy-code which is inefficient. I am looking for sort of a 
component model, which means I have a couple of objects in session or 
even application scope and can directly use then in many different 
forms/actions. But so far I am missing a concept like SWING controls do 
have it where you can bind controls such as a listbox, textbox etc 
directly to objects or even database tables. I think JSF offers similar 
things but I don't see anything alike in struts 1.2.8 (the version I am 
currently using).


Maybe someone could clarify these things for me or you may have some 
good recipes for me, how to solve these things best with Struts.



Many thanks again for your help!

Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Laurie Harper

Tom Bednarz wrote:

David Durham wrote:

Tom Bednarz wrote:
I think the validator fires too early, but probably I am doing 
something wrong. Maybe somebody can hp!


Basically, you need 2 actions, one to populate the form and one to 
change the personal data.


Or at least two action mappings, if you want to use automatic 
validation. If you're happy to invoke validation manually, you can get 
by with just one action and one mapping.


This is EXACTLY what I like to AVOID! With this concept I have to write 
dozends of useless action classes!


Nope, with that approach you would simply *seperate* your one action 
class into two classes which each encapsulate one branch or your if 
statement below -- i.e. an action that does 'Populate the form' and one 
that does 'Perform update operation'.


If you don't like having two separate classes, there are various options 
for combining them, including the various flavours of dispatch action 
and the approach you illustrate below.



In my Action class I did:

public ActionForward execute(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
{
ActionForward af = null;
..

String operation = request.getParameter("operation");
.

if (operation != null &&
operation.compareToIgnoreCase("update") == 0)
{
. Perform update operation here
}
   else  // showData
   {
 Populate form here
   }
   return (new ActionForward("/showPersonalData.do"));
}

The surprising thing (at least for me...) is, that when running in the 
debugger, execute method is NEVER called (does not stop at any 
breakpoint) !!!


Do you have validate="true" on your action mapping? If validate is set 
to true, the framework will perform validation for you automatically 
before invoking the action. Hence, you need to either a) have two action 
mappings in your config (note: two mappings, not necessarily two action 
classes), one with validate=false and operation set to null and one with 
validate=true and operation set to whatever; or b) using a single action 
mapping, set validate=false and call validate() manually as appropriate.


Is there no more intelligent way then creating lots of actions?? Maybe 
this is a motivation to move to JSF!!


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Wendy Smoak

On 8/30/06, Tom Bednarz <[EMAIL PROTECTED]> wrote:


The idea is, that I show a form that contains already data and the user
can edit it. When the form is submitted, the validator should check the
user input. Here is my validator configuration:

...

Now it seems, that the validator gets fired BEFORE the form is filled!
In the JSP that displays the form, I get lots of error messages all
fired by the 'required' validator saying, that the field must not be
empty, but all fields are filled corretly!!.


Request -> form bean population -> validation -> Action.execute() ->
forward -> JSP

My advice is to turn off automatic validation, and call it explicitly
when you want it to happen.  That will stop the 'validation errors on
first form display' problem.

Looking at your config, you always pull values from a session scoped
'subscriber' object.

I don't think you need 'value' here:

   

The 'name' attribute [1] is "The attribute name of the bean whose
properties are consulted when rendering the current value of this
input field."

Does this work?

   

Even after dealing with the 'first display' problem, that still leaves
you validating the form bean (which may be missing data) yet
displaying values from some other bean sitting in session scope.

[1] http://struts.apache.org/1.x/struts-taglib/tlddoc/html/text.html

--
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: validator and DynaValidatorActionForm

2006-08-30 Thread David Friedman
Why are you making these fields so complex?  You have

   

Instead of the simple form:

 ?

Why do you need to specify all of that redundant information like value and
name when you have the property attribute?  And why are you pulling values
from the session scope instead of the request data that was submitted?  That
seems an unusual choice to my thinking.

Also, what is your html:form action specified there?  Is it listed as
"/changePersonalDataForm"? Or another form name?  Using a different form
might be your problem - after all the html:form uses the bean associated
with that form so a different bean would have different values, especially
if you are mixing and matching values from a session scoped bean with a
request that has its own values.

Regards,
David

-Original Message-
From: Tom Bednarz [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 12:34 PM
To: Struts Users Mailing List
Subject: validator and DynaValidatorActionForm


I think the validator fires too early, but probably I am doing something
wrong. Maybe somebody can hp!

I have the following form bean defined in struts-config.xml:

 










 


and the following action mapping:

 
   
   
 


The idea is, that I show a form that contains already data and the user
can edit it. When the form is submitted, the validator should check the
user input. Here is my validator configuration:



   
 
   
   
 
   
   
 
   
   
 
   
   
 
   
   
 
   
   
 
 
   


Now it seems, that the validator gets fired BEFORE the form is filled!
In the JSP that displays the form, I get lots of error messages all
fired by the 'required' validator saying, that the field must not be
empty, but all fields are filled corretly!!.

Here is an extract of the JSP:


   
 

 
 
   
 
 

 
   
   
 
   
 
 
   
 
 
   
 
   
   ...

  

Every row contains a label, an input control and a TD to display
validation errors of the specific field.

Does anybody know what is going wrong here??

Many thanks for your help!

Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread Tom Bednarz

David Durham wrote:

Tom Bednarz wrote:
I think the validator fires too early, but probably I am doing 
something wrong. Maybe somebody can hp!


Basically, you need 2 actions, one to populate the form and one to 
change the personal data.





David,

This is EXACTLY what I like to AVOID! With this concept I have to write 
dozends of useless action classes!


In my Action class I did:

public ActionForward execute(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response)
{
ActionForward af = null;
..

String operation = request.getParameter("operation");
.

if (operation != null &&
operation.compareToIgnoreCase("update") == 0)
{
. Perform update operation here
}
   else  // showData
   {
 Populate form here
   }
   return (new ActionForward("/showPersonalData.do"));
}

The surprising thing (at least for me...) is, that when running in the 
debugger, execute method is NEVER called (does not stop at any 
breakpoint) !!!


Is there no more intelligent way then creating lots of actions?? Maybe 
this is a motivation to move to JSF!!


Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validator and DynaValidatorActionForm

2006-08-30 Thread David Durham

Tom Bednarz wrote:
I think the validator fires too early, but probably I am doing something 
wrong. Maybe somebody can hp!


Basically, you need 2 actions, one to populate the form and one to 
change the personal data.






I have the following form bean defined in struts-config.xml:

type="org.apache.struts.validator.DynaValidatorActionForm" >














and the following action mapping:


  
  



The idea is, that I show a form that contains already data and the user 
can edit it. When the form is submitted, the validator should check the 
user input. Here is my validator configuration:




  

  
  

  
  

  
  

  
  

  
  

  
  


  


Now it seems, that the validator gets fired BEFORE the form is filled! 
In the JSP that displays the form, I get lots of error messages all 
fired by the 'required' validator saying, that the field must not be 
empty, but all fields are filled corretly!!.


Here is an extract of the JSP:


  

   


  


   

  
  

  


  


  

  
  ...

 

Every row contains a label, an input control and a TD to display 
validation errors of the specific field.


Does anybody know what is going wrong here??

Many thanks for your help!

Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator html args

2006-08-22 Thread Niall Pemberton

Theres no way of picking up what was rendered in your view in the
validation config.

If you're "hard coding" your label values rather than putting them in
the message resources though, you can do the same in your
validation.xml - using the resource="false" attribute.

 

... or even the whole error message.

Niall

On 8/22/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:


Hi,

I am using Validator 1.3, I would like to know if I can pass argument
value issued from html element?

I explain me:

I have an html form :

...
User

...

My validation looks like this:






Do you know if there a mean to display the labeluser (font id) instead
of putting value in a resource bundle?

Thanks,

Regards,
Jean-Marie.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator Client-Side and Custom Classes

2006-08-16 Thread Scott Van Wart

Mississippi John Hurt wrote:

Hi,
I want to do client-side validation using a custom class I can specify in
the validator.xml  section. But my
question is if I use a custom class, then how the heck can Struts 
generate
the custom javascript for it in the jsp if I'm using a custom java 
class I

wrote that exists only on the server?  Not possible right?

So if that's the case, if you do leave some custom classname validator 
class

in your validation.xml, then will that validation simply be ignored?

Thanks for help with these 2 questions.

If you look at the source for commons-validator, you'll see a package 
called 'org.apache.commons.validator.javascript'.  It has a bunch of .js 
files as package resources, so you might look at the sources for those 
to get started.  Beyond that I don't have any experience with it (I 
personally can't stand client-side validations, as validation has to be 
done in the database, and on the server side, and I feel inclined to 
draw the line somewhere given a choice :).


The 'validateUtilities.js' seems to have a lot of functions that the 
other .js files make use of, so you should probably do so as well.  It 
also looks like the .js file name, and function name inside the file 
match the method name of your validation routine (with a 'form' 
parameter passed, which is likely an array?).  So if you do all this, I 
would imagine the validator will pick it up automatically (and fail 
silently and ignore it if you don't, as you mentioned above).


Good luck,
 Scott


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator

2006-08-12 Thread Niall Pemberton

From Struts 1.2.7 onwards you can change the keys used with the

"header", "footer", "prefix" and "suffix" attributes

http://struts.apache.org/1.2.9/userGuide/struts-html.html#errors

Niall

On 8/11/06, Kalra, Ashwani <[EMAIL PROTECTED]> wrote:


They are hard coded in mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 2:58 PM
To: Struts Users Mailing List
Subject: Validator


Hi,

I would like to change the key name of errors.header, errors.footer,
errors.suffix ... but I don't see where they are called.

Have you got any idea ?

Thanks,

Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator

2006-08-12 Thread Ted Husted

On 8/11/06, Kalra, Ashwani <[EMAIL PROTECTED]> wrote:

They are hard coded in 

It's not a configurable property, but, if it's an issue for someone,
just plug in your own version of the errors tag.

-Ted.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator

2006-08-11 Thread Dakota Jack

Don't think you really understand the issue, Simian.

On 8/11/06, Monkeyden <[EMAIL PROTECTED]> wrote:


Who cares where they're called or what their values are?  Just add them to
the application resources file.

On 8/11/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I would like to change the key name of errors.header, errors.footer,
> errors.suffix ... but I don't see where they are called.
>
> Have you got any idea ?
>
> Thanks,
>
> Jean-Marie.
>
> ---
> Email Disclaimer
> http://www.cofidis.be/emaildisclaimer.php
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>





--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~


Re: Validator

2006-08-11 Thread Monkeyden

Who cares where they're called or what their values are?  Just add them to
the application resources file.

On 8/11/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:



Hi,

I would like to change the key name of errors.header, errors.footer,
errors.suffix ... but I don't see where they are called.

Have you got any idea ?

Thanks,

Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Validator

2006-08-11 Thread Kalra, Ashwani

They are hard coded in mailto:[EMAIL PROTECTED] 
Sent: Friday, August 11, 2006 2:58 PM
To: Struts Users Mailing List
Subject: Validator


Hi,

I would like to change the key name of errors.header, errors.footer,
errors.suffix ... but I don't see where they are called.

Have you got any idea ?

Thanks,

Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RE : Validator dynamic var

2006-08-07 Thread Niall Pemberton

You could implement your own MessageResources which could call a java
class instead of a properties file.

You would need to do something like the following:

1) Create your own MessageResources implementation:

http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/util/MessageResources.java?view=markup

public class VarMessageResources extends MessageResources {
public String getMessage(Locale locale, String key) {
// call your java class here
}
}

2) Create a MessageResourcesFactory

public class VarMessageResourcesFactory extends MessageResourcesFactory {
   public MessageResources createResources(String config) {
   return new VarMessageResources(this, config, this.returnNull);
   }
}

3) Configure Struts for your custom MessageResources (using a "bundle" key)



4) Reference your custom message resources in the validation.xml

   
   datePattern
   dateOfBirth.pattern
   

Niall

On 8/7/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:


Thank you Niall,

Do you know if I can call a java class instead of a properties file ?

Jean-Marie.

-Message d'origine-
De: Niall Pemberton [mailto:[EMAIL PROTECTED]
Envoyé: lundi 7 août 2006 15:37
À: Struts Users Mailing List
Objet: Re: Validator dynamic var

You can do this in Struts 1.3.x and Commons Validator 1.3.0 where the
 element can come from a resource bundle.

See the "1.2 Variables in Resource Bundles" section here:

  http://wiki.apache.org/jakarta-commons/ValidatorVersion120

Niall

On 8/7/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is it possible to set dynamic variable value in validation.xml file ?
>
> My application is in several language and I would like avoid to define
> several formset definition according to each language to just change
> datepatternstrict value.
>
> Any idea ?
>
> Thanks,
> Regards Jean-Marie.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE : Validator dynamic var

2006-08-07 Thread Jean-Marie Pitre

Thank you Niall,

Do you know if I can call a java class instead of a properties file ?

Jean-Marie.

-Message d'origine-
De : Niall Pemberton [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 7 août 2006 15:37
À : Struts Users Mailing List
Objet : Re: Validator dynamic var

You can do this in Struts 1.3.x and Commons Validator 1.3.0 where the
 element can come from a resource bundle.

See the "1.2 Variables in Resource Bundles" section here:

  http://wiki.apache.org/jakarta-commons/ValidatorVersion120

Niall

On 8/7/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is it possible to set dynamic variable value in validation.xml file ?
>
> My application is in several language and I would like avoid to define
> several formset definition according to each language to just change
> datepatternstrict value.
>
> Any idea ?
>
> Thanks,
> Regards Jean-Marie.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validator not getting called and I can't see why [resolved]

2006-08-07 Thread Givler, Eric
I had a similar problem here.  I used formdef to define the page attribute and 
didn't specify the type.  When the cast was made inside of validator, it was 
unable to cast the value to an Integer.  The field was a string containing the 
page number.  Couldn't it use Integer.valueOf?

-Original Message-
From: Bart Busschots [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 06, 2006 3:33 PM
To: Struts Users Mailing List
Subject: Re: Validator not getting called and I can't see why [resolved]


OK, I got all this figured out in the end.

The validator was being called but because of problems with the page 
attribute in the form the validator appears to have been receiving a 
page value of zero and hence not validating the items on pages 1 or two 
because neither 1 nor 2 are less that or equal to zero! When I did get 
the validator to be called it still wasn't working right but I got that 
fixed too.

Anyhow, I did up a blog post about it which can be found here: 
http://www.bartbusschots.ie/blog/?p=262

If people thing an edited version of this would be a useful addition to 
the Wiki work away, just credit me or link to the original blog post and 
I'll be more than happy.

Cheers for your help guys,

Bart.

Bart Busschots wrote:
> I'm either missing something stupid (which is always possible) or I've 
> managed to break the validator. I have an app that uses validator all 
> over the place and it's working fine in all my other actions but for 
> this one action it is simply not getting called.
>
> I can't see any difference between this action/form/validation and all 
> the other ones that are working.
>
> This is the form:
>
>   type="org.apache.struts.validator.DynaValidatorForm">
>   
>   
>   
>   
>   
>  
>
> This is the action:
>
>   type="vtie.portal.mentor.CreateStudentGroupPrepareAction" 
> name="createStudentGroupForm" scope="session" validate="true" 
> input="/home/mentor/addStudentGroupForm.jsp">
>path="/do/mentor/createAnonymousStudentGroup" />
>path="/home/mentor/getStudentNamesForm.jsp" />
>   
>  
>
> And this is the validation:
>
>  
>   
>mask^[a-zA-Z]+[\w\ 
> ]*$
>
>   
>   
>
>   
>   
>
>   
>  
>
> Can anyone see something obviously wrong there?
>
> Cheers,
>
> Bart.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator dynamic var

2006-08-07 Thread Niall Pemberton

You can do this in Struts 1.3.x and Commons Validator 1.3.0 where the
 element can come from a resource bundle.

See the "1.2 Variables in Resource Bundles" section here:

 http://wiki.apache.org/jakarta-commons/ValidatorVersion120

Niall

On 8/7/06, Jean-Marie Pitre <[EMAIL PROTECTED]> wrote:


Hi,

Is it possible to set dynamic variable value in validation.xml file ?

My application is in several language and I would like avoid to define
several formset definition according to each language to just change
datepatternstrict value.

Any idea ?

Thanks,
Regards Jean-Marie.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator not getting called and I can't see why [resolved]

2006-08-07 Thread Bart Busschots

Romu wrote:

U mean a javascript error ?

No, I don't use clientside validation on my forms. It's going to the 
server anyhow so I don't see the point, just an extra layer for things 
to not work in.



u need to define  a message.properties file too which will define the 
error

messa

Good point, post edited.

Bart.



2006/8/6, Bart Busschots <[EMAIL PROTECTED]>:


OK, I got all this figured out in the end.

The validator was being called but because of problems with the page
attribute in the form the validator appears to have been receiving a
page value of zero and hence not validating the items on pages 1 or two
because neither 1 nor 2 are less that or equal to zero! When I did get
the validator to be called it still wasn't working right but I got that
fixed too.

Anyhow, I did up a blog post about it which can be found here:
http://www.bartbusschots.ie/blog/?p=262

If people thing an edited version of this would be a useful addition to
the Wiki work away, just credit me or link to the original blog post and
I'll be more than happy.

Cheers for your help guys,

Bart.

Bart Busschots wrote:
> I'm either missing something stupid (which is always possible) or I've
> managed to break the validator. I have an app that uses validator all
> over the place and it's working fine in all my other actions but for
> this one action it is simply not getting called.
>
> I can't see any difference between this action/form/validation and all
> the other ones that are working.
>
> This is the form:
>
>   type="org.apache.struts.validator.DynaValidatorForm">
>   
>   
>   
>   
>   
>  
>
> This is the action:
>
>   type="vtie.portal.mentor.CreateStudentGroupPrepareAction"
> name="createStudentGroupForm" scope="session" validate="true"
> input="/home/mentor/addStudentGroupForm.jsp">
>path="/do/mentor/createAnonymousStudentGroup" />
>path="/home/mentor/getStudentNamesForm.jsp" />
>   
>  
>
> And this is the validation:
>
>  
>   
>mask^[a-zA-Z]+[\w\
> ]*$
>
>   
>   
>
>   
>   
>
>   
>  
>
> Can anyone see something obviously wrong there?
>
> Cheers,
>
> Bart.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validator not getting called and I can't see why [resolved]

2006-08-07 Thread Romu

for example  :
mentor.createStudentGroup


.groupName.label = the Student Group Name




2006/8/7, Romu <[EMAIL PROTECTED]>:


U mean a javascript error ?

u need to define  a message.properties file too which will define the
error messa


2006/8/6, Bart Busschots < [EMAIL PROTECTED]>:

> OK, I got all this figured out in the end.
>
> The validator was being called but because of problems with the page
> attribute in the form the validator appears to have been receiving a
> page value of zero and hence not validating the items on pages 1 or two
> because neither 1 nor 2 are less that or equal to zero! When I did get
> the validator to be called it still wasn't working right but I got that
> fixed too.
>
> Anyhow, I did up a blog post about it which can be found here:
> http://www.bartbusschots.ie/blog/?p=262
>
> If people thing an edited version of this would be a useful addition to
> the Wiki work away, just credit me or link to the original blog post and
> I'll be more than happy.
>
> Cheers for your help guys,
>
> Bart.
>
> Bart Busschots wrote:
> > I'm either missing something stupid (which is always possible) or I've
> > managed to break the validator. I have an app that uses validator all
> > over the place and it's working fine in all my other actions but for
> > this one action it is simply not getting called.
> >
> > I can't see any difference between this action/form/validation and all
> > the other ones that are working.
> >
> > This is the form:
> >
> >   > type="org.apache.struts.validator.DynaValidatorForm">
> >   
> >   
> >   
> >   
> >   
> >  
> >
> > This is the action:
> >
> >   > type="vtie.portal.mentor.CreateStudentGroupPrepareAction"
> > name="createStudentGroupForm" scope="session" validate="true"
> > input="/home/mentor/addStudentGroupForm.jsp">
> >> path="/do/mentor/createAnonymousStudentGroup" />
> >> path="/home/mentor/getStudentNamesForm.jsp" />
> >   
> >  
> >
> > And this is the validation:
> >
> >  
> >   
> >mask^[a-zA-Z]+[\w\
> > ]*$
> >
> >   
> >   
> >
> >   
> >   
> >
> >   
> >  
> >
> > Can anyone see something obviously wrong there?
> >
> > Cheers,
> >
> > Bart.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: Validator not getting called and I can't see why [resolved]

2006-08-07 Thread Romu

U mean a javascript error ?

u need to define  a message.properties file too which will define the error
messa


2006/8/6, Bart Busschots <[EMAIL PROTECTED]>:


OK, I got all this figured out in the end.

The validator was being called but because of problems with the page
attribute in the form the validator appears to have been receiving a
page value of zero and hence not validating the items on pages 1 or two
because neither 1 nor 2 are less that or equal to zero! When I did get
the validator to be called it still wasn't working right but I got that
fixed too.

Anyhow, I did up a blog post about it which can be found here:
http://www.bartbusschots.ie/blog/?p=262

If people thing an edited version of this would be a useful addition to
the Wiki work away, just credit me or link to the original blog post and
I'll be more than happy.

Cheers for your help guys,

Bart.

Bart Busschots wrote:
> I'm either missing something stupid (which is always possible) or I've
> managed to break the validator. I have an app that uses validator all
> over the place and it's working fine in all my other actions but for
> this one action it is simply not getting called.
>
> I can't see any difference between this action/form/validation and all
> the other ones that are working.
>
> This is the form:
>
>   type="org.apache.struts.validator.DynaValidatorForm">
>   
>   
>   
>   
>   
>  
>
> This is the action:
>
>   type="vtie.portal.mentor.CreateStudentGroupPrepareAction"
> name="createStudentGroupForm" scope="session" validate="true"
> input="/home/mentor/addStudentGroupForm.jsp">
>path="/do/mentor/createAnonymousStudentGroup" />
>path="/home/mentor/getStudentNamesForm.jsp" />
>   
>  
>
> And this is the validation:
>
>  
>   
>mask^[a-zA-Z]+[\w\
> ]*$
>
>   
>   
>
>   
>   
>
>   
>  
>
> Can anyone see something obviously wrong there?
>
> Cheers,
>
> Bart.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Validator not getting called and I can't see why [resolved]

2006-08-06 Thread Bart Busschots

OK, I got all this figured out in the end.

The validator was being called but because of problems with the page 
attribute in the form the validator appears to have been receiving a 
page value of zero and hence not validating the items on pages 1 or two 
because neither 1 nor 2 are less that or equal to zero! When I did get 
the validator to be called it still wasn't working right but I got that 
fixed too.


Anyhow, I did up a blog post about it which can be found here: 
http://www.bartbusschots.ie/blog/?p=262


If people thing an edited version of this would be a useful addition to 
the Wiki work away, just credit me or link to the original blog post and 
I'll be more than happy.


Cheers for your help guys,

Bart.

Bart Busschots wrote:
I'm either missing something stupid (which is always possible) or I've 
managed to break the validator. I have an app that uses validator all 
over the place and it's working fine in all my other actions but for 
this one action it is simply not getting called.


I can't see any difference between this action/form/validation and all 
the other ones that are working.


This is the form:

 type="org.apache.struts.validator.DynaValidatorForm">

  
  
  
  
  
 

This is the action:

 type="vtie.portal.mentor.CreateStudentGroupPrepareAction" 
name="createStudentGroupForm" scope="session" validate="true" 
input="/home/mentor/addStudentGroupForm.jsp">
  path="/do/mentor/createAnonymousStudentGroup" />
  path="/home/mentor/getStudentNamesForm.jsp" />

  
 

And this is the validation:

 
  
   mask^[a-zA-Z]+[\w\ 
]*$

   
  
  
   
  
  
   
  
 

Can anyone see something obviously wrong there?

Cheers,

Bart.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   3   4   5   >