Re: Problem with Validation "lifecycle"

2010-11-19 Thread Greg Akins
On Fri, Nov 19, 2010 at 11:43 AM, Greg Lindholm  wrote:
> I wrote this to solve the problem of preserving messages across a redirect:
>
> http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/
>

Thanks Greg.  That looks like exactly what I was looking for.  One
question to you, or to the list, someone that commented on your blog
mentioned the MessageStoreInterceptor.  Any pros or cons of using that
over your interceptor?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Problem with Validation "lifecycle"

2010-11-19 Thread Greg Lindholm
I wrote this to solve the problem of preserving messages across a redirect:

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/


On Fri, Nov 19, 2010 at 11:36 AM, Greg Akins  wrote:
> Thanks for the response
>
> On Fri, Nov 19, 2010 at 11:28 AM, Maurizio Cucchiara
>  wrote:
>> As far I can remember actionError are stored in struts stack, so I guess
>> they are per-request.
>
> That's what I thought.
>
>> Also, redirect action create a new request, so you can share AE in a
>> standard flow.
>
> I CAN share actionErrors in the standard flow, but if I use
> redirectAction I lose the original request, right?
>
>> Can't you do without redirect for the input result?
>
> The problems is that when I create the jsp, I set values for whether
> the fields are to be displayed.  Since those are set in the action, if
> I skip that action the fields are displayed.
>
> The only other thing I can think of is to set the display in the other
> action (the one that is redirecting from).. but since I'm falling out
> of the interceptor stack and not getting into the execute method on
> the action, I'm not sure of how I'd do that either.
>
>> 2010/11/19 Greg Akins 
>>>
>>> I've written an action, with validation, that uses a redirectAction
>>> instead of a .jsp for the INPUT result.
>>>
>>> When the final INPUT jsp is displayed, the actionErrors aren't
>>> present.  I believe this is because the action I'm redirecting to
>>> "clears" the actions before the jsp is displayed.  If I save an
>>> actionError on the session, I can retrieve it in the final error...
>>> but this seems less than ideal, and I'm not sure how to get to the
>>> annotation based validators ( I added a session.put() in the
>>> validate() method.
>>>
>>> Is there a way to "carry" the errors across actions in this case? The
>>> INPUT needs to redirect to an action because the action determines
>>> whether certain fields need displayed.. if the INPUT goes straight to
>>> a jsp, the jsp is blank because of the logic I'm using to display
>>> fields.
>>>
>>> Struts 2.2.1
>>>
>>> --
>>> Greg Akins
>>>
>>> http://insomnia-consulting.org
>>> http://www.pghcodingdojo.org
>>> http://pittjug.dev.java.net
>>> http://twitter.com/akinsgre
>>> http://www.linkedin.com/in/akinsgre
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>
>>
>>
>> --
>> Maurizio Cucchiara
>>
>
>
>
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Problem with Validation "lifecycle"

2010-11-19 Thread Greg Akins
Thanks for the response

On Fri, Nov 19, 2010 at 11:28 AM, Maurizio Cucchiara
 wrote:
> As far I can remember actionError are stored in struts stack, so I guess
> they are per-request.

That's what I thought.

> Also, redirect action create a new request, so you can share AE in a
> standard flow.

I CAN share actionErrors in the standard flow, but if I use
redirectAction I lose the original request, right?

> Can't you do without redirect for the input result?

The problems is that when I create the jsp, I set values for whether
the fields are to be displayed.  Since those are set in the action, if
I skip that action the fields are displayed.

The only other thing I can think of is to set the display in the other
action (the one that is redirecting from).. but since I'm falling out
of the interceptor stack and not getting into the execute method on
the action, I'm not sure of how I'd do that either.

> 2010/11/19 Greg Akins 
>>
>> I've written an action, with validation, that uses a redirectAction
>> instead of a .jsp for the INPUT result.
>>
>> When the final INPUT jsp is displayed, the actionErrors aren't
>> present.  I believe this is because the action I'm redirecting to
>> "clears" the actions before the jsp is displayed.  If I save an
>> actionError on the session, I can retrieve it in the final error...
>> but this seems less than ideal, and I'm not sure how to get to the
>> annotation based validators ( I added a session.put() in the
>> validate() method.
>>
>> Is there a way to "carry" the errors across actions in this case? The
>> INPUT needs to redirect to an action because the action determines
>> whether certain fields need displayed.. if the INPUT goes straight to
>> a jsp, the jsp is blank because of the logic I'm using to display
>> fields.
>>
>> Struts 2.2.1
>>
>> --
>> Greg Akins
>>
>> http://insomnia-consulting.org
>> http://www.pghcodingdojo.org
>> http://pittjug.dev.java.net
>> http://twitter.com/akinsgre
>> http://www.linkedin.com/in/akinsgre
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>
>
>
> --
> Maurizio Cucchiara
>



-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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



Re: Problem with Validation "lifecycle"

2010-11-19 Thread Maurizio Cucchiara
As far I can remember actionError are stored in struts stack, so I guess
they are per-request.
Also, redirect action create a new request, so you can share AE in a
standard flow.
Can't you do without redirect for the input result?

2010/11/19 Greg Akins 

> I've written an action, with validation, that uses a redirectAction
> instead of a .jsp for the INPUT result.
>
> When the final INPUT jsp is displayed, the actionErrors aren't
> present.  I believe this is because the action I'm redirecting to
> "clears" the actions before the jsp is displayed.  If I save an
> actionError on the session, I can retrieve it in the final error...
> but this seems less than ideal, and I'm not sure how to get to the
> annotation based validators ( I added a session.put() in the
> validate() method.
>
> Is there a way to "carry" the errors across actions in this case? The
> INPUT needs to redirect to an action because the action determines
> whether certain fields need displayed.. if the INPUT goes straight to
> a jsp, the jsp is blank because of the logic I'm using to display
> fields.
>
> Struts 2.2.1
>
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Maurizio Cucchiara


Re: Problem with Validation framework

2008-04-24 Thread Lukasz Lenart
>  class="com.intuit.sbfw.action.mc.UserLookupAction">


UserLookupAction-validation.xml is in the same path as class above?


> 2) I see this message when I invoke my very first action: INFO
>  [ActionValidatorManagerFactory] Detected AnnotationActionValidatorManager,
> initializing it...
> Does this mean that I have to use Annotation only to configure the
> validation rules and I cannot use the xml approach?


No, you can, but you can also use in the same time xml base validation


> 3) What could be wrong with my setup so that my validation classes are not
> working?
>

Check if xml file is in the same path when you deploy your application. Do
you use maven2?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart


RE: Problem with Validation framework

2008-04-24 Thread Sanjeewa Saman
HI
I hope that this will help you 

http://struts2issues.blogspot.com/

BR,
sanj
-Original Message-
From: Pranav [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 24, 2008 6:32 AM
To: user@struts.apache.org
Subject: Problem with Validation framework

Hi All,

I am having a problem with validation framework. This is the first time I am
trying to use struts2 validation. Here's different code pieces that I have.

 UserLookupAction-validation.xml




   You must enter a value for Member ID.
   
   
 20
 
 Member ID cannot contain more than 20 characters
   
 




### finduser.jsp


  
  
   
   
Find user record by Member ID: 


   
   
  
  initial
content
  

## struts.xml


  /html/finduser.jsp
   /html/finduserResult.jsp



Notes:
1) My package extends from struts-default and so I am using the
defaultStack.
2) My Action class UserLookupAction extends from ActionSupport class.

Questions:
1) I am not seeing any validation error even when i leave the memberId as
blank. The log file does not say anything at all. Is it because I am using
theme as "ajax"?
2) I see this message when I invoke my very first action: INFO
[ActionValidatorManagerFactory] Detected AnnotationActionValidatorManager,
initializing it...
Does this mean that I have to use Annotation only to configure the
validation rules and I cannot use the xml approach?
3) What could be wrong with my setup so that my validation classes are not
working?

Thanks
Pranav




 


Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

-
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: Problem with validation rule

2006-07-17 Thread Adam Gordon
Heh, it happens to the best of us.  Happy coding.

-Adam

-Original Message-
From: Sebastian Stein [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 16 July 2006 10:20
To: Struts Users Mailing List
Subject: Re: Problem with validation rule

Sebastian Stein <[EMAIL PROTECTED]> [060716 11:50]:
> Adam Gordon <[EMAIL PROTECTED]> [060715 09:50]:
> > What happens if you remove the "requireList" dependency and just use
"mask?"
> 
> It is driving me crazy. I removed the requireList dependency and nothing
> changed. I removed the complete validation for menuForm from
validation.xml
> and nothing changed. I changed validate="true" to false in
struts-config.xml
> and nothing changed. Also I deleted all the tomcat generated files in the
> tomcat/work directly, but nothing changed. However, if I change for
example
> the struts-config.xml file in a way that it uses another jsp than at least
> another jsp is shown.
> 
> There seems to go something completely wired going on and I have no idea
> what it is. Is there another point where one can define validation rules
for
> a form?

I found it. The form was not extending ValidatorForm but instead ActionForm.


Sebastian

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


Re: Problem with validation rule

2006-07-16 Thread Sebastian Stein
Sebastian Stein <[EMAIL PROTECTED]> [060716 11:50]:
> Adam Gordon <[EMAIL PROTECTED]> [060715 09:50]:
> > What happens if you remove the "requireList" dependency and just use "mask?"
> 
> It is driving me crazy. I removed the requireList dependency and nothing
> changed. I removed the complete validation for menuForm from validation.xml
> and nothing changed. I changed validate="true" to false in struts-config.xml
> and nothing changed. Also I deleted all the tomcat generated files in the
> tomcat/work directly, but nothing changed. However, if I change for example
> the struts-config.xml file in a way that it uses another jsp than at least
> another jsp is shown.
> 
> There seems to go something completely wired going on and I have no idea
> what it is. Is there another point where one can define validation rules for
> a form?

I found it. The form was not extending ValidatorForm but instead ActionForm.


Sebastian

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



Re: Problem with validation rule

2006-07-16 Thread Sebastian Stein
Adam Gordon <[EMAIL PROTECTED]> [060715 09:50]:
> What happens if you remove the "requireList" dependency and just use "mask?"

It is driving me crazy. I removed the requireList dependency and nothing
changed. I removed the complete validation for menuForm from validation.xml
and nothing changed. I changed validate="true" to false in struts-config.xml
and nothing changed. Also I deleted all the tomcat generated files in the
tomcat/work directly, but nothing changed. However, if I change for example
the struts-config.xml file in a way that it uses another jsp than at least
another jsp is shown.

There seems to go something completely wired going on and I have no idea
what it is. Is there another point where one can define validation rules for
a form?


Sebastian


> Sebastian Stein wrote:
> >Hi,
> >
> >I have a form, which should also use validation based on a mask. I already
> >enabled this kind of validation in another form and there it works. So I
> >guess I just have a type or did something wrong during copy&paste. Here is
> >the form definition in the struts-config.xml:
> >
> >   > type="org.contineo.forms.MenuForm">
> >  >type="java.lang.String"/>
> >  
> >
> >...
> >
> >   >  name="menuForm"
> >  path="/SaveMenu"
> >  scope="request"
> >  type="org.contineo.actions.admin.menu.SaveMenuAction"
> >  validate="true">
> >  >  path="/pages/addMenu.jsp"
> >  redirect="false"/>
> >  
> >
> >And here is the validation rule:
> >
> >  
> >  >depends="requireList,mask">
> >
> >   count
> >   1
> >
> >
> >   field0
> >   menuGroup
> >
> >
> >   mask
> >   ^[a-zA-Z]*$
> >
> > > key="errors.required"
> > resource="true"/>
> > > key="errors.val.username"
> > resource="true"/>
> > 
> >  
> >
> >Interestingly the requireList validation rule works. So if the user does 
> >not
> >select something in field0, the validation fails. However, the mask rule is
> >not applied. It seems the content of menuText is not checked against the
> >pattern.
> >
> >Does anybody can spot the error? I'm using Struts 1.1.
> >
> >
> >Sebastian
> >
> >-
> >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]
> 

-- 
http://www.hpfsc.de/ - die Seite rund um:
Assembler, Bundeswehr, TFT LCDs, Halle/Saale, Fahrradtouren, Neuseeland,
Wanderstaat Mauma, Raumschiff USS Nathan, Enemy Room, MLCAD Tutorial

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



Re: Problem with validation rule

2006-07-14 Thread Adam Gordon

Sebastian-

What happens if you remove the "requireList" dependency and just use "mask?"

-Adam

Sebastian Stein wrote:

Hi,

I have a form, which should also use validation based on a mask. I already
enabled this kind of validation in another form and there it works. So I
guess I just have a type or did something wrong during copy&paste. Here is
the form definition in the struts-config.xml:

  
 
  

...

  
 
  

And here is the validation rule:

  
 

   count
   1


   field0
   menuGroup


   mask
   ^[a-zA-Z]*$



 
  

Interestingly the requireList validation rule works. So if the user does not
select something in field0, the validation fails. However, the mask rule is
not applied. It seems the content of menuText is not checked against the
pattern.

Does anybody can spot the error? I'm using Struts 1.1.


Sebastian

-
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: Problem with Validation of Struts DynaValidatorForm

2005-09-11 Thread Weng Kong Lee
Hi Laurie,

Thanks for the suggestion!

After digging into the Tomcat console logs, I've finally found out
what the problem is. Seems like my copy of validation-rules.xml was
corrupted. The arguments for the validateRequired method were wrong.
Corrected that and now it works fine :-)

Thanks for the reminder though on the tpye-casting for the form. That
could save me a lot of brain-cells some time down the line...

Weng Kong Lee

On 9/12/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> You probably need your form to be declared as type
> org.apache.struts.action.DynaActionForm (rather than DynaValidatorForm).
> The difference between their behaviour is a little subtle so it's easy
> to get them mixed up. Try changing it and see if it works.
> 
> L.
> 
> Weng Kong Lee wrote:
> > Hi all,
> > I've just started exploring the use of Struts DynaValidatorForms. I've
> > tried to set-up a very simple login form with a username and password
> > fields, where both are required. Here's the relevant details:
> >
> > 1. struts-config.xml
> > The application message resource bundle has been configured with the
> > required validation messages for the validation framework, and the
> > validator plugin is also declared.
> > I declared a form bean as follows:
> >  > type="org.apache.struts.validator.DynaValidatorForm">form-bean
> > name="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
> > 
> > 
> > 
> > 
> > Then I declared a action tied to the form bean as follows:
> >  >   attribute="loginForm"
> >   input="/login.jsp"
> >   name="loginForm"
> >   path="/login"
> >   scope="request"
> >   type="project.struts.actions.LoginAction"
> >   validate="true">
> >   
> >   
> > 
> >
> > 2. login.jsp
> > This is the JSP with the form. It uses both client and server-side
> > validation.The code is as follows:
> > 
> > 
> >  > onsubmit="return validateLoginForm(this);">
> >   
> > 
> >   Login:
> >   
> > 
> > 
> >   Password:
> >   
> > 
> > 
> >   
> > 
> >   
> > 
> > 
> > 
> >
> > 3. validation.xml
> > I declared both the "userName" and the "password" fields to be
> > "required", as follows:
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > 4. Action class, LoginAction.java
> > Here's the execute mehod implementation. Basically, it rejects the
> > login when the userName and password are not both "test".
> > public ActionForward execute(ActionMapping mapping, ActionForm form,
> >   HttpServletRequest request, HttpServletResponse 
> > response) {
> > DynaValidatorForm loginForm = (DynaValidatorForm) form;
> > String userName = loginForm.getString("userName");
> > String password = loginForm.getString("password");
> > if ((userName == null) || (!userName.equals("test"))) {
> > return mapping.findForward("failure");
> > } else if ((password == null) || (!password.equals("test"))) {
> > return mapping.findForward("failure");
> > } else {
> > return mapping.findForward("success");
> > }
> > }
> >
> > I then tried to test the above by deploying the application, hitting
> > login.jsp and attempting to login with invalid userName and password.
> > The Javascript validation works fine, and the messages display
> > correctly => The message resource is configured correctly.
> >
> > However when I turned off Javascript on my bowser to test the
> > server-side validation. The validation did not take place at all! If I
> > supplied a blank userName and/or password, it simply performs the
> > logic in LoginAction and sends me back to login.jsp, without any error
> > messages!
> >
> > Anyone has any ideas what I might have missed out here?
> >
> > Thanks in advance for any suggestions!
> >
> > Weng Kong Lee
> 
> 
> -
> 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: Problem with Validation of Struts DynaValidatorForm

2005-09-11 Thread Laurie Harper
You probably need your form to be declared as type 
org.apache.struts.action.DynaActionForm (rather than DynaValidatorForm). 
The difference between their behaviour is a little subtle so it's easy 
to get them mixed up. Try changing it and see if it works.


L.

Weng Kong Lee wrote:

Hi all,
I've just started exploring the use of Struts DynaValidatorForms. I've
tried to set-up a very simple login form with a username and password
fields, where both are required. Here's the relevant details:

1. struts-config.xml
The application message resource bundle has been configured with the
required validation messages for the validation framework, and the
validator plugin is also declared.
I declared a form bean as follows:
form-bean
name="loginForm" type="org.apache.struts.validator.DynaValidatorForm">




Then I declared a action tied to the form bean as follows:

  
  


2. login.jsp
This is the JSP with the form. It uses both client and server-side
validation.The code is as follows:



  

  Login:
  


  Password:
  


  

  




3. validation.xml
I declared both the "userName" and the "password" fields to be
"required", as follows:











4. Action class, LoginAction.java
Here's the execute mehod implementation. Basically, it rejects the
login when the userName and password are not both "test".
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse 
response) {
DynaValidatorForm loginForm = (DynaValidatorForm) form;
String userName = loginForm.getString("userName");
String password = loginForm.getString("password");
if ((userName == null) || (!userName.equals("test"))) {
return mapping.findForward("failure");
} else if ((password == null) || (!password.equals("test"))) {
return mapping.findForward("failure");
} else {
return mapping.findForward("success");
}
}

I then tried to test the above by deploying the application, hitting
login.jsp and attempting to login with invalid userName and password.
The Javascript validation works fine, and the messages display
correctly => The message resource is configured correctly.

However when I turned off Javascript on my bowser to test the
server-side validation. The validation did not take place at all! If I
supplied a blank userName and/or password, it simply performs the
logic in LoginAction and sends me back to login.jsp, without any error
messages!

Anyone has any ideas what I might have missed out here?

Thanks in advance for any suggestions!

Weng Kong Lee



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



RE: Problem with validation (?)

2004-12-10 Thread Jim Barrows
> -Original Message-
> From: aris [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 09, 2004 11:23 AM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation (?)
> 
> 
> From: "Wendy Smoak" <[EMAIL PROTECTED]>
> 
> > From: "aris" <[EMAIL PROTECTED]>



> 
> I use the debugger for my Java code but before to debug 
> Struts Java code I
> think it's a best practice to read the documentation or post 
> a question on
> the ml... don't you?

That depends on who you think is manning this list.  I, for instance, post and 
help because I learn more about struts this way then I would just doing 
everything myself.   This makes me a more employable.  I also do this at work, 
so I have to balance what I answer and what I don't.
So, I like it when people come to the list who have already done the leg work 
on a problem.  Spending some time with a debugger and the documentation is a 
good thing. 
 
Now, that doesn't mean that I don't like newbie questions, I just don't answer 
them with more then pointing them at the documentation. Then, if they still 
have trouble will get more detailed.  

The bottom line though is this there are no list members who are getting 
paid to man the list (as their primary job).  So, making a minimum of impact on 
our time and resources is just being a good neighbor.

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



Re: Problem with validation (?)

2004-12-10 Thread aris
From: "Derek Broughton" <[EMAIL PROTECTED]>

> On Thursday 09 December 2004 14:28, Wendy Smoak wrote:
> > From: "aris" <[EMAIL PROTECTED]>
> >
> > > > Use String (and occasionally Boolean) for form fields and things
will
> >
> > work
> >
> > > > the way you need them to.
> > >
> > > I don't understand your answer... If I need an Integer field for my
> > > ActionForm derived class why I've to use a String?
> >
> > What happens when somebody types "ABCDE" into your Integer field on the
> > form, and it fails validation?  Can you re-display the incorrect user
input
> > so they can see what they typed and why it was wrong?
>
> Or more concisely, because HTML only has string types.

Mmmm... I think that HTML has not types at all.


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



Re: Problem with validation (?)

2004-12-10 Thread aris
From: "Wendy Smoak" <[EMAIL PROTECTED]>

> From: "aris" <[EMAIL PROTECTED]>
>
> > > Use String (and occasionally Boolean) for form fields and things will
> work
> > > the way you need them to.
> >
> > I don't understand your answer... If I need an Integer field for my
> > ActionForm derived class why I've to use a String?
>
> What happens when somebody types "ABCDE" into your Integer field on the
> form, and it fails validation?  Can you re-display the incorrect user
input
> so they can see what they typed and why it was wrong?

Ok, so... I didn't understand your answer in the context of my question: I
had an hidden field with value="" and my question was "does ValidatorPlugin
set a default value on a field of type Integer after validation?".

By the way the answer to your second question is "no, I can't" ... but I
have an hidden field pre-populated from my Action so it's value is null or
it's an Integer

Bye,
aris


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



Re: Problem with validation (?)

2004-12-09 Thread Derek Broughton
On Thursday 09 December 2004 19:09, Laconia Data Systems wrote:
> Derek-
> Any conversions (String to Integer or whatever) need to happen in your
> Business Bean layer

Not me... I just replied to a reply. :-)
-- 
derek

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



Re: Problem with validation (?)

2004-12-09 Thread Derek Broughton
On Thursday 09 December 2004 18:02, Wendy Smoak wrote:
> From: "Derek Broughton" <[EMAIL PROTECTED]>
>
> > > What happens when somebody types "ABCDE" into your Integer field on the
> > > form, and it fails validation?  Can you re-display the incorrect user
>
> input
>
> > > so they can see what they typed and why it was wrong?
> >
> > Or more concisely, because HTML only has string types.
>
> Oh, sure, take all the fun out of it. ;)  Teach a man to fish, and all...
>
> It begs the question though: is there a case for using Integer in an
> ActionForm?  I know the reasons *not* to (and I don't) but it must be there
> for a reason?

Beats me.   I'm still new to this.  Using strings was just something I ran 
across in a tutorial early :-)
-- 
derek

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



Re: Problem with validation (?)

2004-12-09 Thread Laconia Data Systems
Derek-
Any conversions (String to Integer or whatever) need to happen in your
Business Bean layer
e.g.
ActionForm which uses Strings and booleans
private String IntegerDisplay = null;
public String getIntegerDisplay()
{
 return this.IntegerDisplay();
}
public void setDateIntegerDisplay(String display)
{
 this.IntegerDisplay = display;
}

//Business Bean
public class BusinessBean extends BeanUtils
{
//Default constructor as per spec..
 public BusinessBean() { ; }
 public Integer intn = null;
 public String getIntegerDisplay() {
  try
 {
  intn = getInteger();
  if(ConvertUtils.isNull(intn)) return null;
  return intn.toString();
  }
 catch(NumberFormatException d)
 {
  System.out.println("Bad integer has been passed in do something");
 }
 catch(NullPointerException n)
 {
 System.out.println("Null found you passed me a null Integer!");
 }
}//end getIntegerDisplay

public void setIntegerDisplay(String display)
{
 if(display=null) intn = null;
 else
 {
  try
  { //set the value..
   setDisplay(Integer.valueOf(display));
  }
  catch(Throwable t)
  { //exception found set to null
   setDisplay(null);
  }//end catch
 } //end else
}//end setIntegerDisplay
Now what is that about teaching a man to fish?
Hope this helps,
Martin=
- Original Message - 
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 5:02 PM
Subject: Re: Problem with validation (?)


> From: "Derek Broughton" <[EMAIL PROTECTED]>
>
> > > What happens when somebody types "ABCDE" into your Integer field on
the
> > > form, and it fails validation?  Can you re-display the incorrect user
> input
> > > so they can see what they typed and why it was wrong?
> >
> > Or more concisely, because HTML only has string types.
>
> Oh, sure, take all the fun out of it. ;)  Teach a man to fish, and all...
>
> It begs the question though: is there a case for using Integer in an
> ActionForm?  I know the reasons *not* to (and I don't) but it must be
there
> for a reason?
>
> -- 
> Wendy Smoak
>
>
> -
> 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: Problem with validation (?)

2004-12-09 Thread Matt Bathje
Wendy Smoak wrote:
From: "Matt Bathje" <[EMAIL PROTECTED]>
What do you mean by "must be there for a reason"? As far as I know, a
form property can be any class type that you want it to be.

Sorry, I think only in terms of dynamic forms, and there is a list of
allowed field types:
http://struts.apache.org/userGuide/building_controller.html#dyna_action_form_classes

Ahh yes, I do remember reading that at some point. The reason I have 
forgotten about it is that I do things like:


Or even:

which both work fine for me under DynaValidatorForm and 
DynaValidatorActionForm (and are not considered taboo like using Integer 
afaik)


There had to be a reason that Integer made it on the list, I just wondered
why.

I have a feeling that list is a holdover from the old-timey days of 
struts, and is since outdated/invalid. Unfortunately I don't have time 
to take a look at the code and figure out what is going on for sure. 
(And possibly fix that passage...)

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


Re: Problem with validation (?)

2004-12-09 Thread Wendy Smoak
From: "Matt Bathje" <[EMAIL PROTECTED]>

> What do you mean by "must be there for a reason"? As far as I know, a
> form property can be any class type that you want it to be.

Sorry, I think only in terms of dynamic forms, and there is a list of
allowed field types:
http://struts.apache.org/userGuide/building_controller.html#dyna_action_form_classes

> Unless I missed something, there is no special set of classes that they
> can be set to. (There is obviously a special set of classes that you
> should not set it to be as it is not best practices though...)

Prevailing wisdom is that you "should not" use anything but String/String[]
(and possibly Boolean).  Yet Integer is allowed, causing me to occasionally
snap at people who use it and then complain that it doesn't work right.

There had to be a reason that Integer made it on the list, I just wondered
why.

-- 
Wendy Smoak


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



Re: Problem with validation (?)

2004-12-09 Thread Matt Bathje
Wendy Smoak wrote:
From: "Derek Broughton" <[EMAIL PROTECTED]>
What happens when somebody types "ABCDE" into your Integer field on the
form, and it fails validation?  Can you re-display the incorrect user
input
so they can see what they typed and why it was wrong?
Or more concisely, because HTML only has string types.

Oh, sure, take all the fun out of it. ;)  Teach a man to fish, and all...
It begs the question though: is there a case for using Integer in an
ActionForm?  I know the reasons *not* to (and I don't) but it must be there
for a reason?
Raises not begs! (sorry, pet peeve of mine :P)
What do you mean by "must be there for a reason"? As far as I know, a 
form property can be any class type that you want it to be.

Unless I missed something, there is no special set of classes that they 
can be set to. (There is obviously a special set of classes that you 
should not set it to be as it is not best practices though...)

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


Re: Problem with validation (?)

2004-12-09 Thread Hubert Rabago
One situation I might consider this acceptable is when it's for a
field that uses a drop down as the control, and I'm sure that my users
won't try to be smart with me by submitting the form using their own
hand made HTML.  In this case, I don't have to worry about the
typos/invalid values.
In my actual apps, though, I just stick with strings.

Hubert


On Thu, 09 Dec 2004 15:02:36 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> It begs the question though: is there a case for using Integer in an
> ActionForm?  I know the reasons *not* to (and I don't) but it must be there
> for a reason?
> 
> --
> Wendy Smoak
>

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



Re: Problem with validation (?)

2004-12-09 Thread Wendy Smoak
From: "Derek Broughton" <[EMAIL PROTECTED]>

> > What happens when somebody types "ABCDE" into your Integer field on the
> > form, and it fails validation?  Can you re-display the incorrect user
input
> > so they can see what they typed and why it was wrong?
>
> Or more concisely, because HTML only has string types.

Oh, sure, take all the fun out of it. ;)  Teach a man to fish, and all...

It begs the question though: is there a case for using Integer in an
ActionForm?  I know the reasons *not* to (and I don't) but it must be there
for a reason?

-- 
Wendy Smoak


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



Re: Problem with validation (?)

2004-12-09 Thread Derek Broughton
On Thursday 09 December 2004 14:28, Wendy Smoak wrote:
> From: "aris" <[EMAIL PROTECTED]>
>
> > > Use String (and occasionally Boolean) for form fields and things will
>
> work
>
> > > the way you need them to.
> >
> > I don't understand your answer... If I need an Integer field for my
> > ActionForm derived class why I've to use a String?
>
> What happens when somebody types "ABCDE" into your Integer field on the
> form, and it fails validation?  Can you re-display the incorrect user input
> so they can see what they typed and why it was wrong?

Or more concisely, because HTML only has string types.
-- 
derek

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



Re: Problem with validation (?)

2004-12-09 Thread Wendy Smoak
From: "aris" <[EMAIL PROTECTED]>

> > Use String (and occasionally Boolean) for form fields and things will
work
> > the way you need them to.
>
> I don't understand your answer... If I need an Integer field for my
> ActionForm derived class why I've to use a String?

What happens when somebody types "ABCDE" into your Integer field on the
form, and it fails validation?  Can you re-display the incorrect user input
so they can see what they typed and why it was wrong?

-- 
Wendy Smoak


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



Re: Problem with validation (?)

2004-12-09 Thread aris
From: "Wendy Smoak" <[EMAIL PROTECTED]>

> From: "aris" <[EMAIL PROTECTED]>
> > When I submit the form, after the validation process I have value="0"
(the
> > field is an Integer) but I haven't set validation rules on this field :|
>
> Use String (and occasionally Boolean) for form fields and things will work
> the way you need them to.

I don't understand your answer... If I need an Integer field for my
ActionForm derived class why I've to use a String?

> > In my opinion the validator plugin uses a default value read somewhere
to
> > fill the value of the hidden field (but I didn't set anything !?!)
>
> More likely you're seeing the result of the conversion from String to
> Integer when Struts populates your ActionForm from the request.  The best
> way to see what's actually happening is to run the whole thing in a
> debugger-- an hour with JSwat will teach you more than an entire day
> studying the documentation.

I use the debugger for my Java code but before to debug Struts Java code I
think it's a best practice to read the documentation or post a question on
the ml... don't you?

Bye,
aris.


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



Re: Problem with validation (?)

2004-12-09 Thread aris
Hi all,
I solved my problem ...reading the documentation

At page http://struts.apache.org/userGuide/building_view.html
at section "3.3.5 The Struts Validator" I read:
[...]
Note: If your required form property is one of the Java object
representations of primitive types (ie. java.lang.Integer), you must set the
ActionServlet's convertNull init. parameter to true. Failing to do this will
result in the required validation not being performed on that field because
it will default to 0.
[...]

So I followed the note and I modified my web.xml in this way:

   action
   org.apache.struts.action.ActionServlet
   
  convertNull
  true
   
   ...


And all works fine! It was so simple!

Sorry for my worthless question :(

Bye,
aris




- Original Message - 
From: "aris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 6:48 PM
Subject: Problem with validation (?)


> Hi all,
>
> I've a strange behaviour with my application and I suppose the reason is
the
> ValidatorPlugIn.
>
> I've an html form with an hidden field and the pre-population lets its
> value="" (this is right because the value of the field in the associated
> ValidatorForm is null).
> When I submit the form, after the validation process I have value="0" (the
> field is an Integer) but I haven't set validation rules on this field :|
>
> In my opinion the validator plugin uses a default value read somewhere to
> fill the value of the hidden field (but I didn't set anything !?!)
>
> Can anyone help me?
>
> Thanks,
> aris
>
>
>
> -
> 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: Problem with validation (?)

2004-12-09 Thread Wendy Smoak
From: "aris" <[EMAIL PROTECTED]>
> When I submit the form, after the validation process I have value="0" (the
> field is an Integer) but I haven't set validation rules on this field :|

Use String (and occasionally Boolean) for form fields and things will work
the way you need them to.

> In my opinion the validator plugin uses a default value read somewhere to
> fill the value of the hidden field (but I didn't set anything !?!)

More likely you're seeing the result of the conversion from String to
Integer when Struts populates your ActionForm from the request.  The best
way to see what's actually happening is to run the whole thing in a
debugger-- an hour with JSwat will teach you more than an entire day
studying the documentation.

-- 
Wendy Smoak



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



RE: Problem with validation using both minlength and maxlength on the same field

2004-12-02 Thread David G. Friedman
Bill,

I like how you think! Hats off to you for that good idea.

Regards,
David

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
Sent: Thursday, December 02, 2004 10:21 AM
To: [EMAIL PROTECTED]
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


AFAIK you cannot pull the minlength and maxlength values from the
resource bundle; BUT, you can define these values as global constants in
a validation.xml file. If you want, you could create a separate
validation-constants.xml file only containing these values; making it
easier for modification.

-Bill Siggelkow

David G. Friedman wrote:


> AHA!  It all makes sense then.  Since I didn't
> see a way to make the ... tag pull
> from a resource, is there any way to do that?
> Then, theoretically, I can make the arg AND the
> var pull from the same resource label and make
> it easier for someone else to modify things
> instead of giving them access to the validation
> file.  A quick read of the source code for
> the commons validator Var object doesn't
> suggest any blatant way to do this, not to me.
> Do you think I should I submit a bugzilla
> enhancement request if there isn't a way to do
> it?  After all, the other fields can pull from
> a resource. *sad puppy dog look*
>
> Maybe we should bold the note about var fields
> being required.  Speed readers like me, in this
> case, sometimes miss key points like that. :)
>
> Regards and thanks for clearing this up for me,
> David
>
> -Original Message-
> From: Niall Pemberton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 02, 2004 4:24 AM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
>
> David,
>
> Its not a bug, its not designed to work that way.
>
> For the minlength validator you have to specify a minlength 
otherwise
> it doesn't work properly (it will check for a minimum length of zero,
which
> is nonsense).
>
> For the maxlength validator you have to specify a maxlength 
otherwise
> it doesn't work properly (it will check for a maximum length of zero,
which
> is also nonsense).
>
> The  elements are only used as replacement values for error
messages -
> not by the validator in actually checking the minimum or maximum length.
>
> Niall
>
> - Original Message -
> From: "David G. Friedman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, December 02, 2004 6:09 AM
> Subject: RE: Problem with validation using both minlength and maxlength on
> the same field
>
>
>
>>Niall,
>>
>>Derek isn't crazy and this looks like a bug to me IF your args try to use
>>'resource="true"'.  I duplicated the problem using Struts 1.2.4 with the
>>commons validator 1.1.3 and 1.1.4 jars.  Sadly, the java code suggests
>>resource="true" works in 1.1.4 but I can't get it to work even with a new
>>1.1.4 testing jar AND fully stopping/restarting Tomcat 5.5.4.
>
> Essentially,
>
>>I'm seeing resource="true" use the message resources to fill out the error
>>fields on both the client and server sides, just not populating the vars
>
> for
>
>>the client or server side validations to be able to use them.
>>
>>For example, using this rule, call it "rule A", everything works normally
>
> on
>
>>the client and server sides:
>>
>>
>>
>>
>>
>>
>>minlength7
>>maxlength20
>>
>>
>>
>>Modifying this into "rule B", the validation will not work on the client
>>side OR the server side, BUT the error messages show the appropriate
>
> message
>
>>resources numbers and words (for the arg0 field name, for example).  Here
>
> is
>
>>"rule B":
>>
>>
>>
>>
>>
> />
>
>>
> />
>
>>
>>
>>
>>My message resources file works properly (tested thoroughly) with:
>>testingForm.name=Name
>>testingForm.name.min=7
>>testingForm.name.max=20
>>
>>At: /WEB-INF/classes/resources/Application.properties
>>In struts-config.xml as:
>>
>>
>>Here is the lower level stuff showing the problem.  With "rule A", our
>>Validation methods set maxlength, minlength, etc. properties as expected
>
> in
>
>>the JavaScript such as:
>>
>>function ValidationForm_required () {
>> this.a0 = new 

Re: Problem with validation using both minlength and maxlength on the same field

2004-12-02 Thread Niall Pemberton
I had a similar thought recently - maybe adding key/bundle attributes to the
 element or something along those lines. Currently I don't have any
time to look at this but my initial thought is that it would be a v.useful
enhancement. Currently you can specify multiple formsets with different
Locales - but to my mind people probably only need to do that when they have
e.g. different date patterns for different Locales - adding this kind of
feature would probably largely remove the need for duplicating multiple
formsets in most situations.

To pursue this you need to either raise it for discussion on the commons-dev
list or created a bugzilla enhancement ticket against Commons Validator.

Documentation patches are always welcome, if you feel like submitting one to
make the need for the minlength/maxlength  clearer - although in the
validator user guide under "Standard Built In Validations" it does say that
these are required.

Niall

- Original Message - 
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 2:12 PM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field


> AHA!  It all makes sense then.  Since I didn't
> see a way to make the ... tag pull
> from a resource, is there any way to do that?
> Then, theoretically, I can make the arg AND the
> var pull from the same resource label and make
> it easier for someone else to modify things
> instead of giving them access to the validation
> file.  A quick read of the source code for
> the commons validator Var object doesn't
> suggest any blatant way to do this, not to me.
> Do you think I should I submit a bugzilla
> enhancement request if there isn't a way to do
> it?  After all, the other fields can pull from
> a resource. *sad puppy dog look*
>
> Maybe we should bold the note about var fields
> being required.  Speed readers like me, in this
> case, sometimes miss key points like that. :)
>
> Regards and thanks for clearing this up for me,
> David
>
> -Original Message-
> From: Niall Pemberton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 02, 2004 4:24 AM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
>
> David,
>
> Its not a bug, its not designed to work that way.
>
> For the minlength validator you have to specify a minlength 
otherwise
> it doesn't work properly (it will check for a minimum length of zero,
which
> is nonsense).
>
> For the maxlength validator you have to specify a maxlength 
otherwise
> it doesn't work properly (it will check for a maximum length of zero,
which
> is also nonsense).
>
> The  elements are only used as replacement values for error
messages -
> not by the validator in actually checking the minimum or maximum length.
>
> Niall
>
> - Original Message -
> From: "David G. Friedman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, December 02, 2004 6:09 AM
> Subject: RE: Problem with validation using both minlength and maxlength on
> the same field
>
>
> > Niall,
> >
> > Derek isn't crazy and this looks like a bug to me IF your args try to
use
> > 'resource="true"'.  I duplicated the problem using Struts 1.2.4 with the
> > commons validator 1.1.3 and 1.1.4 jars.  Sadly, the java code suggests
> > resource="true" works in 1.1.4 but I can't get it to work even with a
new
> > 1.1.4 testing jar AND fully stopping/restarting Tomcat 5.5.4.
> Essentially,
> > I'm seeing resource="true" use the message resources to fill out the
error
> > fields on both the client and server sides, just not populating the vars
> for
> > the client or server side validations to be able to use them.
> >
> > For example, using this rule, call it "rule A", everything works
normally
> on
> > the client and server sides:
> >
> > 
> > 
> > 
> > 
> > 
> >
minlength7
> >
maxlength20
> > 
> > 
> >
> > Modifying this into "rule B", the validation will not work on the client
> > side OR the server side, BUT the error messages show the appropriate
> message
> > resources numbers and words (for the arg0 field name, for example).
Here
> is
> > "rule B":
> >
> > 
> > 
> > 
> >  />
> >  />
> > 
> > 
> >
> > My message resources file wor

Re: Problem with validation using both minlength and maxlength on the same field

2004-12-02 Thread Bill Siggelkow
AFAIK you cannot pull the minlength and maxlength values from the 
resource bundle; BUT, you can define these values as global constants in 
a validation.xml file. If you want, you could create a separate 
validation-constants.xml file only containing these values; making it 
easier for modification.

-Bill Siggelkow
David G. Friedman wrote:

AHA!  It all makes sense then.  Since I didn't
see a way to make the ... tag pull
from a resource, is there any way to do that?
Then, theoretically, I can make the arg AND the
var pull from the same resource label and make
it easier for someone else to modify things
instead of giving them access to the validation
file.  A quick read of the source code for
the commons validator Var object doesn't
suggest any blatant way to do this, not to me.
Do you think I should I submit a bugzilla
enhancement request if there isn't a way to do
it?  After all, the other fields can pull from
a resource. *sad puppy dog look*
Maybe we should bold the note about var fields
being required.  Speed readers like me, in this
case, sometimes miss key points like that. :)
Regards and thanks for clearing this up for me,
David
-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 02, 2004 4:24 AM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field
David,
Its not a bug, its not designed to work that way.
For the minlength validator you have to specify a minlength  otherwise
it doesn't work properly (it will check for a minimum length of zero, which
is nonsense).
For the maxlength validator you have to specify a maxlength  otherwise
it doesn't work properly (it will check for a maximum length of zero, which
is also nonsense).
The  elements are only used as replacement values for error messages -
not by the validator in actually checking the minimum or maximum length.
Niall
- Original Message -
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 6:09 AM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field

Niall,
Derek isn't crazy and this looks like a bug to me IF your args try to use
'resource="true"'.  I duplicated the problem using Struts 1.2.4 with the
commons validator 1.1.3 and 1.1.4 jars.  Sadly, the java code suggests
resource="true" works in 1.1.4 but I can't get it to work even with a new
1.1.4 testing jar AND fully stopping/restarting Tomcat 5.5.4.
Essentially,
I'm seeing resource="true" use the message resources to fill out the error
fields on both the client and server sides, just not populating the vars
for
the client or server side validations to be able to use them.
For example, using this rule, call it "rule A", everything works normally
on
the client and server sides:

   
   
   
   
   minlength7
   maxlength20
   

Modifying this into "rule B", the validation will not work on the client
side OR the server side, BUT the error messages show the appropriate
message
resources numbers and words (for the arg0 field name, for example).  Here
is
"rule B":

   
   
   />
   />
   

My message resources file works properly (tested thoroughly) with:
testingForm.name=Name
testingForm.name.min=7
testingForm.name.max=20
At: /WEB-INF/classes/resources/Application.properties
In struts-config.xml as:

Here is the lower level stuff showing the problem.  With "rule A", our
Validation methods set maxlength, minlength, etc. properties as expected
in
the JavaScript such as:
function ValidationForm_required () {
this.a0 = new Array("name", "Name is required.", new Function
("varName", "this.maxlength='20'; this.minlength='7';  return
this[varName];"));
   }
   function ValidationForm_minlength () {
this.a0 = new Array("name", "Name can not be less than 7
characters.",
new Function ("varName", "this.maxlength='20'; this.minlength='7';  return
this[varName];"));
   }
   function ValidationForm_maxlength () {
this.a0 = new Array("name", "Name can not be greater than 20
characters.", new Function ("varName", "this.maxlength='20';
this.minlength='7';  return this[varName];"));
   }
And in the server-side Java Field object:
Field:
key = name
property = name
indexedProperty = null
indexedListProperty = null
depends = required, minlength, maxlength
page = 0
fieldOrder = 0
Vars:
maxlength=Var: name=maxlength  value=20  jsType=null
minlength=Var: name=minlength  value=7  jsType=null
However, set the resource="true" as in "rule B", and you are missing that
information

RE: Problem with validation using both minlength and maxlength on the same field

2004-12-02 Thread David G. Friedman
AHA!  It all makes sense then.  Since I didn't
see a way to make the ... tag pull
from a resource, is there any way to do that?
Then, theoretically, I can make the arg AND the
var pull from the same resource label and make
it easier for someone else to modify things
instead of giving them access to the validation
file.  A quick read of the source code for
the commons validator Var object doesn't
suggest any blatant way to do this, not to me.
Do you think I should I submit a bugzilla
enhancement request if there isn't a way to do
it?  After all, the other fields can pull from
a resource. *sad puppy dog look*

Maybe we should bold the note about var fields
being required.  Speed readers like me, in this
case, sometimes miss key points like that. :)

Regards and thanks for clearing this up for me,
David

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 02, 2004 4:24 AM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


David,

Its not a bug, its not designed to work that way.

For the minlength validator you have to specify a minlength  otherwise
it doesn't work properly (it will check for a minimum length of zero, which
is nonsense).

For the maxlength validator you have to specify a maxlength  otherwise
it doesn't work properly (it will check for a maximum length of zero, which
is also nonsense).

The  elements are only used as replacement values for error messages -
not by the validator in actually checking the minimum or maximum length.

Niall

- Original Message -
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 6:09 AM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field


> Niall,
>
> Derek isn't crazy and this looks like a bug to me IF your args try to use
> 'resource="true"'.  I duplicated the problem using Struts 1.2.4 with the
> commons validator 1.1.3 and 1.1.4 jars.  Sadly, the java code suggests
> resource="true" works in 1.1.4 but I can't get it to work even with a new
> 1.1.4 testing jar AND fully stopping/restarting Tomcat 5.5.4.
Essentially,
> I'm seeing resource="true" use the message resources to fill out the error
> fields on both the client and server sides, just not populating the vars
for
> the client or server side validations to be able to use them.
>
> For example, using this rule, call it "rule A", everything works normally
on
> the client and server sides:
>
> 
> 
> 
> 
> 
> minlength7
> maxlength20
> 
> 
>
> Modifying this into "rule B", the validation will not work on the client
> side OR the server side, BUT the error messages show the appropriate
message
> resources numbers and words (for the arg0 field name, for example).  Here
is
> "rule B":
>
> 
> 
> 
> 
> 
> 
> 
>
> My message resources file works properly (tested thoroughly) with:
> testingForm.name=Name
> testingForm.name.min=7
> testingForm.name.max=20
>
> At: /WEB-INF/classes/resources/Application.properties
> In struts-config.xml as:
> 
>
> Here is the lower level stuff showing the problem.  With "rule A", our
> Validation methods set maxlength, minlength, etc. properties as expected
in
> the JavaScript such as:
>
> function ValidationForm_required () {
>  this.a0 = new Array("name", "Name is required.", new Function
> ("varName", "this.maxlength='20'; this.minlength='7';  return
> this[varName];"));
> }
>
> function ValidationForm_minlength () {
>  this.a0 = new Array("name", "Name can not be less than 7
characters.",
> new Function ("varName", "this.maxlength='20'; this.minlength='7';  return
> this[varName];"));
> }
>
> function ValidationForm_maxlength () {
>  this.a0 = new Array("name", "Name can not be greater than 20
> characters.", new Function ("varName", "this.maxlength='20';
> this.minlength='7';  return this[varName];"));
> }
>
> And in the server-side Java Field object:
>
> Field:
> key = name
> property = name
> indexedProperty = null
> indexedListProperty = null
> depends = required, minlength, maxlength
> page = 0
> fieldOrder = 0
> Vars:
> maxlength=Var: name=maxlength  value=20  jsType=null
>
> minlength=Var: name=minlength  value=7  jsType=null
>
> However, set 

Re: Problem with validation using both minlength and maxlength on the same field

2004-12-02 Thread Niall Pemberton
David,

Its not a bug, its not designed to work that way.

For the minlength validator you have to specify a minlength  otherwise
it doesn't work properly (it will check for a minimum length of zero, which
is nonsense).

For the maxlength validator you have to specify a maxlength  otherwise
it doesn't work properly (it will check for a maximum length of zero, which
is also nonsense).

The  elements are only used as replacement values for error messages -
not by the validator in actually checking the minimum or maximum length.

Niall

- Original Message - 
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 6:09 AM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field


> Niall,
>
> Derek isn't crazy and this looks like a bug to me IF your args try to use
> 'resource="true"'.  I duplicated the problem using Struts 1.2.4 with the
> commons validator 1.1.3 and 1.1.4 jars.  Sadly, the java code suggests
> resource="true" works in 1.1.4 but I can't get it to work even with a new
> 1.1.4 testing jar AND fully stopping/restarting Tomcat 5.5.4.
Essentially,
> I'm seeing resource="true" use the message resources to fill out the error
> fields on both the client and server sides, just not populating the vars
for
> the client or server side validations to be able to use them.
>
> For example, using this rule, call it "rule A", everything works normally
on
> the client and server sides:
>
> 
> 
> 
> 
> 
> minlength7
> maxlength20
> 
> 
>
> Modifying this into "rule B", the validation will not work on the client
> side OR the server side, BUT the error messages show the appropriate
message
> resources numbers and words (for the arg0 field name, for example).  Here
is
> "rule B":
>
> 
> 
> 
> 
> 
> 
> 
>
> My message resources file works properly (tested thoroughly) with:
> testingForm.name=Name
> testingForm.name.min=7
> testingForm.name.max=20
>
> At: /WEB-INF/classes/resources/Application.properties
> In struts-config.xml as:
> 
>
> Here is the lower level stuff showing the problem.  With "rule A", our
> Validation methods set maxlength, minlength, etc. properties as expected
in
> the JavaScript such as:
>
> function ValidationForm_required () {
>  this.a0 = new Array("name", "Name is required.", new Function
> ("varName", "this.maxlength='20'; this.minlength='7';  return
> this[varName];"));
> }
>
> function ValidationForm_minlength () {
>  this.a0 = new Array("name", "Name can not be less than 7
characters.",
> new Function ("varName", "this.maxlength='20'; this.minlength='7';  return
> this[varName];"));
> }
>
> function ValidationForm_maxlength () {
>  this.a0 = new Array("name", "Name can not be greater than 20
> characters.", new Function ("varName", "this.maxlength='20';
> this.minlength='7';  return this[varName];"));
> }
>
> And in the server-side Java Field object:
>
> Field:
> key = name
> property = name
> indexedProperty = null
> indexedListProperty = null
> depends = required, minlength, maxlength
> page = 0
> fieldOrder = 0
> Vars:
> maxlength=Var: name=maxlength  value=20  jsType=null
>
> minlength=Var: name=minlength  value=7  jsType=null
>
> However, set the resource="true" as in "rule B", and you are missing that
> information on both the client side and the server side:
>
>  function ValidationForm_required () {
>  this.a0 = new Array("name", "Name is required.", new Function
> ("varName", " return this[varName];"));
> }
>
> function ValidationForm_minlength () {
>  this.a0 = new Array("name", "Name can not be less than 7
characters.",
> new Function ("varName", " return this[varName];"));
> }
>
> function ValidationForm_maxlength () {
>  this.a0 = new Array("name", "Name can not be greater than 20
> characters.", new Function ("varName", " return this[varName];"));
> }
>
> And for the server-side your Field object ALSO lacks the variables:
>
> Field:
> key = name
> property = name
> indexedProperty = null
> indexedListProperty = null
> depends = required, minlen

RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread David G. Friedman
xlength, this.error.required,
this.error.intRange, etc. instead of being Array index 1 (if starting from a
zero array index position)

b) Initialization for each object is in one place.  Since the JavaScript
appears to look for an object matching the first name of the Array anyway,
wouldn't this be cleaner and less redundant?

Should I post the top part and/or the bottom part to Buzilla?  Which one?
Commons or Struts?  Opinions are requested on this one plus a few more
people to triple check this by performing their own simple tests like mine.

Regards,
David

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 8:11 PM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


You need to specify maxlength and minlength variables.

  



        
     minlength10


 maxlength20


Alternatively, if its an integer field you could use the intRange validator
instead

  




 min10


 max20



Niall

- Original Message -
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 12:46 AM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field


> Derek,
>
> I'm seeing the same thing you described.  I'm sorry I didn't believe you.
> Sadly, I'm having a HELL of a time figuring out what's wrong because I
> recently upgraded my development setup to Struts 1.2.4 and Tomcat 5.5.4
and
> haven't used validation in a while.  Trying the 1.1.4 validator binary
> didn't help any.  I'm feeling really stupid since used to be able to get
> this to work.  Too many variables have changed on me. *sigh*
>
> Regards,
> David
>
> -Original Message-
> From: Derek Broughton [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 1:18 PM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
>
> On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> > I'm trying to validate a simple field.  I want to validate that the
field
> > is an integer, and meets the min and max length requirements.  In the
same
> > application I am able to correctly validate a date field so I'm
confident
> > my overall struts setup is correct.  However when I try to do both a min
> > and max length check on the same field, the max length check doesn't
work.
> >  If I exceed the max length I get the min length message.  Below is a
> > snippet from my validation.xml file.  I've setup my properties file to
> > include the min and max length constants.
> >
> > validation.xml
> > ...
> > ...
> >   >property="myField"
> >depends="minlength, maxlength, integer">
> >
> >
> >
>
> Despite two other good looking answers, I'd have to say that it seems
> unlikely
> that these should _both_ be "arg1" :-)
> --
> derek
>
> -
> 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: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Niall Pemberton
You need to specify maxlength and minlength variables.

  




 minlength10


 maxlength20


Alternatively, if its an integer field you could use the intRange validator
instead

  




 min10


 max20



Niall

- Original Message - 
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 12:46 AM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field


> Derek,
>
> I'm seeing the same thing you described.  I'm sorry I didn't believe you.
> Sadly, I'm having a HELL of a time figuring out what's wrong because I
> recently upgraded my development setup to Struts 1.2.4 and Tomcat 5.5.4
and
> haven't used validation in a while.  Trying the 1.1.4 validator binary
> didn't help any.  I'm feeling really stupid since used to be able to get
> this to work.  Too many variables have changed on me. *sigh*
>
> Regards,
> David
>
> -Original Message-
> From: Derek Broughton [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 1:18 PM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
>
> On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> > I'm trying to validate a simple field.  I want to validate that the
field
> > is an integer, and meets the min and max length requirements.  In the
same
> > application I am able to correctly validate a date field so I'm
confident
> > my overall struts setup is correct.  However when I try to do both a min
> > and max length check on the same field, the max length check doesn't
work.
> >  If I exceed the max length I get the min length message.  Below is a
> > snippet from my validation.xml file.  I've setup my properties file to
> > include the min and max length constants.
> >
> > validation.xml
> > ...
> > ...
> >   >property="myField"
> >depends="minlength, maxlength, integer">
> >
> >
> >
>
> Despite two other good looking answers, I'd have to say that it seems
> unlikely
> that these should _both_ be "arg1" :-)
> --
> derek
>
> -
> 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: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread David G. Friedman
Derek,

I'm seeing the same thing you described.  I'm sorry I didn't believe you.
Sadly, I'm having a HELL of a time figuring out what's wrong because I
recently upgraded my development setup to Struts 1.2.4 and Tomcat 5.5.4 and
haven't used validation in a while.  Trying the 1.1.4 validator binary
didn't help any.  I'm feeling really stupid since used to be able to get
this to work.  Too many variables have changed on me. *sigh*

Regards,
David

-Original Message-
From: Derek Broughton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 1:18 PM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> I'm trying to validate a simple field.  I want to validate that the field
> is an integer, and meets the min and max length requirements.  In the same
> application I am able to correctly validate a date field so I'm confident
> my overall struts setup is correct.  However when I try to do both a min
> and max length check on the same field, the max length check doesn't work.
>  If I exceed the max length I get the min length message.  Below is a
> snippet from my validation.xml file.  I've setup my properties file to
> include the min and max length constants.
>
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>
>

Despite two other good looking answers, I'd have to say that it seems
unlikely
that these should _both_ be "arg1" :-)
--
derek

-
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: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Derek Broughton
On Wednesday 01 December 2004 14:28, David G. Friedman wrote:

> P.S. Question for the Day: Why do so many questions lately seem to be
> clearly answered in the UserGuides yet always asked?

Because very little is _clearly_ answered in the UserGuides, particularly that 
question.  In hindsight, he was trying to do something that is probably 
illegal, but it's a matter of "what isn't specifically allowed is 
disallowed". I had the impression it was possible to do what he was doing 
too.  In further hindsight, I see Jim actually said what I meant (I seem to 
have omitted a "not"), anyway...

> -Original Message-
> From: Derek Broughton [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 1:18 PM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
> On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> > I'm trying to validate a simple field.  I want to validate that the field
> > is an integer, and meets the min and max length requirements.  In the
> > same application I am able to correctly validate a date field so I'm
> > confident my overall struts setup is correct.  However when I try to do
> > both a min and max length check on the same field, the max length check
> > doesn't work. If I exceed the max length I get the min length message. 
> > Below is a snippet from my validation.xml file.  I've setup my properties
> > file to include the min and max length constants.
> >
> > validation.xml
> > ...
> > ...
> >   >property="myField"
> >depends="minlength, maxlength, integer">
> >
> >
> >

-- 
derek

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



RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread David G. Friedman
Actually, they are both arg1 for their respective validators... See the
docs:
http://struts.apache.org/userGuide/dev_validator.html

minlength - validate input data isn't less than a specified minimum length.
Requires a minlength variable.




minlength3


maxlength - validate input data doesn't exceed a specified maximum length.
Requires a maxlength variable.




maxlength30


Regards,
David

P.S. Question for the Day: Why do so many questions lately seem to be
clearly answered in the UserGuides yet always asked?

-Original Message-
From: Derek Broughton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 1:18 PM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> I'm trying to validate a simple field.  I want to validate that the field
> is an integer, and meets the min and max length requirements.  In the same
> application I am able to correctly validate a date field so I'm confident
> my overall struts setup is correct.  However when I try to do both a min
> and max length check on the same field, the max length check doesn't work.
>  If I exceed the max length I get the min length message.  Below is a
> snippet from my validation.xml file.  I've setup my properties file to
> include the min and max length constants.
>
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>
>

Despite two other good looking answers, I'd have to say that it seems
unlikely
that these should _both_ be "arg1" :-)
--
derek

-
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: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Derek Broughton
On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> I'm trying to validate a simple field.  I want to validate that the field
> is an integer, and meets the min and max length requirements.  In the same
> application I am able to correctly validate a date field so I'm confident
> my overall struts setup is correct.  However when I try to do both a min
> and max length check on the same field, the max length check doesn't work.
>  If I exceed the max length I get the min length message.  Below is a
> snippet from my validation.xml file.  I've setup my properties file to
> include the min and max length constants.
>
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>
>

Despite two other good looking answers, I'd have to say that it seems unlikely 
that these should _both_ be "arg1" :-)
-- 
derek

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



RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Ram Venkataswamy
This is do with argument number - change errors.maxlength={0} can not be
greater than {1} characters. 

To 

errors.maxlength={0} can not be greater than {2} characters.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 9:49 AM
To: [EMAIL PROTECTED]
Subject: Problem with validation using both minlength and maxlength on
the same field

I'm trying to validate a simple field.  I want to validate that the
field 
is an integer, and meets the min and max length requirements.  In the
same 
application I am able to correctly validate a date field so I'm
confident 
my overall struts setup is correct.  However when I try to do both a min

and max length check on the same field, the max length check doesn't
work. 
 If I exceed the max length I get the min length message.  Below is a 
snippet from my validation.xml file.  I've setup my properties file to 
include the min and max length constants.

validation.xml
...
...
 
   
   
   
 
...
...

SampleApp.properties
...
...
   errors.required={0} is required.
   errors.minlength={0} can not be less than {1} characters.
   errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.

   errors.byte={0} must be a byte.
   errors.short={0} must be a short.
   errors.integer={0} must be an integer.
   errors.long={0} must be a long.
   errors.float={0} must be a float.
   errors.double={0} must be a double.

   errors.date={0} is not a date.
   errors.range={0} is not in the range {1} through {2}.
   errors.creditcard={0} is an invalid credit card number.
   errors.email={0} is an invalid e-mail address.
...
...
   sampleApp.myField.label=My field:
   sampleApp.myField.minLen=5
   sampleApp.myField.maxLen=5



If I enter 8 charcters in myField and submit I get "My field: can not be

less than 5 characters."

Any ideas what's wrong?

Thanks,

James

-
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: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Jim Barrows
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 10:49 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with validation using both minlength and maxlength on
> the same field
> 
> 
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>

One of these is not correct.. arg1 for both, probably confusing 
Validator.

>


minlength3

maxlength30

>  

have you thought of intRange instead?  Probably closer to what you're 
looking for.  Error message would make more sense maybe.  Number must be fewer 
then X characters is odder then Number must be between X and XX.  Or maybe 
not...


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