RE: form validation question

2004-01-28 Thread Andy Kriger
Looks like there is a functional change or bug in the action input attribute
in Struts 1.1 - a forward name must be used instead of the location of a JSP
or Action. Not sure why this change happened between 1.1RC and 1.1rel -
maybe someone on the Struts dev team can answer?

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 2:46 PM
To: Struts Users Mailing List
Subject: form validation question

I am having a curious problem with form validation. I submit a form, see in
the logs that the form fails to validate, however, the webapp does not
return to the input page (I get a blank page with no HTML in it), so I do
not see the form with error messages as expected. If I put text in the
field, the form does submit correctly and I see the JSP specified in the
resulting action chain. The log files have no error messages indicating
something is amiss. When validation fails, the subsequent action is
definitely not running (I do not see the logging in the execute method).

Does anyone have any ideas what could be happening here? 
Or how I can track down the problem?
Below is the relevant info...

=== STRUTS CONFIG ===




 



=== orderForm.jsp ===


<%=err%>








=== VALIDATION CONFIG ===






=== LOG MESSAGES ===
[org.apache.struts.action.RequestProcessor][RequestProcessor]
Validating input form properties
[org.apache.struts.action.RequestProcessor][RequestProcessor]
Validation failed, returning to '/OrderForm.do'



Andy Kriger | Software Mechanic | Greater Than One, Inc.
28 West 27th Street | 7th Floor | New York, NY 10001
P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] 



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



RE: form validation question

2004-01-28 Thread Andy Kriger
It didn't make any difference if I used an action or the JSP for the input
attribute. 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 6:55 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Ok, maybe, I'd have to check into struts code to really be
certain("input"
surely has some significance is what i'm thinking..) So just for the heck of
it though, what happens if you do say "/web/forms/orderForm.jsp" instead?

Andy Kriger wrote:

> OrderForm.do = /web/forms/orderForm.jsp That shouldn't make a 
> difference. I like to refer to actions rather than JSPs to minimize 
> the number of things I have to change if a JSP changes to a different 
> JSP or to another action.
>
> -Original Message-
> From: Geeta Ramani [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 27, 2004 3:27 PM
> To: Struts Users Mailing List
> Subject: Re: form validation question
>
> Andy:
>
> Any reason why you have the unusual "input" param..?
>
>  >  type="MyClass"
> >  name="orderForm"
> >  validate="true"
> >  input="/OrderForm.do"
> >  scope="request">
> >  
> >
>
> I woud have thought you'd use this instead:
>
>  >  type="MyClass"
> >  name="orderForm"
> >  validate="true"
> >  input="/web/forms/orderForm.jsp"
> >  scope="request">
> >  
> >
>
> Regards,
> Geeta
>
> >
> > Andy Kriger wrote:
> >
> > > I am having a curious problem with form validation. I submit a 
> > > form, see in the logs that the form fails to validate, however, 
> > > the webapp does not return to the input page (I get a blank page 
> > > with no HTML in it), so I do not see the form with error messages 
> > > as expected. If I put text in the field, the form does submit 
> > > correctly and I see the JSP specified in the resulting action 
> > > chain. The log files have no error messages indicating something 
> > > is amiss. When validation fails, the subsequent action is 
> > > definitely not running (I do not see the
> logging in the execute method).
> > >
> > > Does anyone have any ideas what could be happening here?
> > > Or how I can track down the problem?
> > > Below is the relevant info...
> > >
> > > === STRUTS CONFIG ===
> > >
> > > 
> > >
> > >  > >  type="MyClass"
> > >  name="orderForm"
> > >  validate="true"
> > >  input="/OrderForm.do"
> > >  scope="request">
> > >  
> > >
> > >  > > type="org.apache.struts.actions.ForwardAction"/>
> > >
> > > === orderForm.jsp ===
> > > 
> > > 
> > > <%=err%>
> > > 
> > > 
> > >
> > > 
> > > 
> > >  
> > >
> > > === VALIDATION CONFIG ===
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > === LOG MESSAGES ===
> > > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > > Validating input form properties
> > > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > > Validation failed, returning to '/OrderForm.do'
> > >
> > > Andy Kriger | Software Mechanic | Greater Than One, Inc.
> > > 28 West 27th Street | 7th Floor | New York, NY 10001
> > > P: 212.252.7197 | F: 212.252.7364 | E: [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]


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



Re: form validation question

2004-01-27 Thread Geeta Ramani
Ok, maybe, I'd have to check into struts code to really be certain("input"
surely has some significance is what i'm thinking..) So just for the heck of it
though, what happens if you do say "/web/forms/orderForm.jsp" instead?

Andy Kriger wrote:

> OrderForm.do = /web/forms/orderForm.jsp
> That shouldn't make a difference. I like to refer to actions rather than
> JSPs to minimize the number of things I have to change if a JSP changes to a
> different JSP or to another action.
>
> -Original Message-
> From: Geeta Ramani [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 27, 2004 3:27 PM
> To: Struts Users Mailing List
> Subject: Re: form validation question
>
> Andy:
>
> Any reason why you have the unusual "input" param..?
>
>  >  type="MyClass"
> >  name="orderForm"
> >  validate="true"
> >  input="/OrderForm.do"
> >  scope="request">
> >  
> >
>
> I woud have thought you'd use this instead:
>
>  >  type="MyClass"
> >  name="orderForm"
> >  validate="true"
> >  input="/web/forms/orderForm.jsp"
> >  scope="request">
> >  
> >
>
> Regards,
> Geeta
>
> >
> > Andy Kriger wrote:
> >
> > > I am having a curious problem with form validation. I submit a form,
> > > see in the logs that the form fails to validate, however, the webapp
> > > does not return to the input page (I get a blank page with no HTML
> > > in it), so I do not see the form with error messages as expected. If
> > > I put text in the field, the form does submit correctly and I see
> > > the JSP specified in the resulting action chain. The log files have
> > > no error messages indicating something is amiss. When validation
> > > fails, the subsequent action is definitely not running (I do not see the
> logging in the execute method).
> > >
> > > Does anyone have any ideas what could be happening here?
> > > Or how I can track down the problem?
> > > Below is the relevant info...
> > >
> > > === STRUTS CONFIG ===
> > >
> > > 
> > >
> > >  > >  type="MyClass"
> > >  name="orderForm"
> > >  validate="true"
> > >  input="/OrderForm.do"
> > >  scope="request">
> > >  
> > >
> > >  > > type="org.apache.struts.actions.ForwardAction"/>
> > >
> > > === orderForm.jsp ===
> > > 
> > > 
> > > <%=err%>
> > > 
> > > 
> > >
> > > 
> > > 
> > >  
> > >
> > > === VALIDATION CONFIG ===
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > === LOG MESSAGES ===
> > > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > > Validating input form properties
> > > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > > Validation failed, returning to '/OrderForm.do'
> > >
> > > Andy Kriger | Software Mechanic | Greater Than One, Inc.
> > > 28 West 27th Street | 7th Floor | New York, NY 10001
> > > P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question

2004-01-27 Thread Andy Kriger
orderForm was extending DynaValidatorForm. I changed this to
DynaValidatorActionForm - now the form validates (though it shouldn't -
there's a required field missing). Looks like I'm one step closer to a
solution.

Thank you for the idea.

-Original Message-
From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 5:10 PM
To: 'Struts Users Mailing List'
Subject: RE: form validation question

Your orderForm does extend ValidatorForm instead of ActionForm right? The
struts validator plug-in relies on your forms extending ValidatorForm in
order to do server-side validations.

Out of curiosity, you may want to see if client-side validation works first.

 ...



When the submit button is pressed, if the required field is empty, you
should get a message window indicating the field is required.

Brian Barnett


-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 1:16 PM
To: 'Struts Users Mailing List'
Subject: RE: form validation question

I see an empty page - no HTML, no nothing. It's as if the handoff to the
input path never happens, even though the logging informs me that validation
failed and the input path is being returned to. When you say 'a question of
display not working right', what do you have in mind? 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 3:05 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

What do you see in the source of the html page..? Maybe it is just a
question of display not working right..?

Geeta

Andy Kriger wrote:

> I am having a curious problem with form validation. I submit a form, 
> see in the logs that the form fails to validate, however, the webapp 
> does not return to the input page (I get a blank page with no HTML in 
> it), so I do not see the form with error messages as expected. If I 
> put text in the field, the form does submit correctly and I see the 
> JSP specified in the resulting action chain. The log files have no 
> error messages indicating something is amiss. When validation fails, 
> the subsequent action is definitely not running (I do not see the 
> logging
in the execute method).
>
> Does anyone have any ideas what could be happening here?
> Or how I can track down the problem?
> Below is the relevant info...
>
> === STRUTS CONFIG ===
>
> 
>
>   type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/OrderForm.do"
>  scope="request">
>  
>
>  type="org.apache.struts.actions.ForwardAction"/>
>
> === orderForm.jsp ===
> 
> 
> <%=err%>
> 
> 
>
> 
> 
>  
>
> === VALIDATION CONFIG ===
> 
> 
> 
> 
> 
>
> === LOG MESSAGES ===
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validating input form properties
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validation failed, returning to '/OrderForm.do'
>
> Andy Kriger | Software Mechanic | Greater Than One, Inc.
> 28 West 27th Street | 7th Floor | New York, NY 10001
> P: 212.252.7197 | F: 212.252.7364 | E: [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]


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



RE: form validation question

2004-01-27 Thread Andy Kriger
OrderForm.do = /web/forms/orderForm.jsp
That shouldn't make a difference. I like to refer to actions rather than
JSPs to minimize the number of things I have to change if a JSP changes to a
different JSP or to another action.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 3:27 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

Any reason why you have the unusual "input" param..?

  type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/OrderForm.do"
>  scope="request">
>  
>

I woud have thought you'd use this instead:

  type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/web/forms/orderForm.jsp"
>  scope="request">
>  
>

Regards,
Geeta

>
> Andy Kriger wrote:
>
> > I am having a curious problem with form validation. I submit a form, 
> > see in the logs that the form fails to validate, however, the webapp 
> > does not return to the input page (I get a blank page with no HTML 
> > in it), so I do not see the form with error messages as expected. If 
> > I put text in the field, the form does submit correctly and I see 
> > the JSP specified in the resulting action chain. The log files have 
> > no error messages indicating something is amiss. When validation 
> > fails, the subsequent action is definitely not running (I do not see the
logging in the execute method).
> >
> > Does anyone have any ideas what could be happening here?
> > Or how I can track down the problem?
> > Below is the relevant info...
> >
> > === STRUTS CONFIG ===
> >
> > 
> >
> >  >  type="MyClass"
> >  name="orderForm"
> >  validate="true"
> >  input="/OrderForm.do"
> >  scope="request">
> >  
> >
> >  > type="org.apache.struts.actions.ForwardAction"/>
> >
> > === orderForm.jsp ===
> > 
> > 
> > <%=err%>
> > 
> > 
> >
> > 
> > 
> >  
> >
> > === VALIDATION CONFIG ===
> > 
> > 
> > 
> > 
> > 
> >
> > === LOG MESSAGES ===
> > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > Validating input form properties
> > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > Validation failed, returning to '/OrderForm.do'
> >
> > Andy Kriger | Software Mechanic | Greater Than One, Inc.
> > 28 West 27th Street | 7th Floor | New York, NY 10001
> > P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question

2004-01-27 Thread Geeta Ramani
Andy:

Any reason why you have the unusual "input" param..?

  type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/OrderForm.do"
>  scope="request">
> 
> 
>

I woud have thought you'd use this instead:

  type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/web/forms/orderForm.jsp"
>  scope="request">
> 
> 
>

Regards,
Geeta

>
> Andy Kriger wrote:
>
> > I am having a curious problem with form validation. I submit a form, see in
> > the logs that the form fails to validate, however, the webapp does not
> > return to the input page (I get a blank page with no HTML in it), so I do
> > not see the form with error messages as expected. If I put text in the
> > field, the form does submit correctly and I see the JSP specified in the
> > resulting action chain. The log files have no error messages indicating
> > something is amiss. When validation fails, the subsequent action is
> > definitely not running (I do not see the logging in the execute method).
> >
> > Does anyone have any ideas what could be happening here?
> > Or how I can track down the problem?
> > Below is the relevant info...
> >
> > === STRUTS CONFIG ===
> >
> > 
> >
> >  >  type="MyClass"
> >  name="orderForm"
> >  validate="true"
> >  input="/OrderForm.do"
> >  scope="request">
> > 
> > 
> >
> >  > type="org.apache.struts.actions.ForwardAction"/>
> >
> > === orderForm.jsp ===
> > 
> > 
> > <%=err%>
> > 
> > 
> >
> > 
> > 
> > 
> > 
> >
> > === VALIDATION CONFIG ===
> > 
> > 
> > 
> > 
> > 
> >
> > === LOG MESSAGES ===
> > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > Validating input form properties
> > [org.apache.struts.action.RequestProcessor][RequestProcessor]
> > Validation failed, returning to '/OrderForm.do'
> >
> > Andy Kriger | Software Mechanic | Greater Than One, Inc.
> > 28 West 27th Street | 7th Floor | New York, NY 10001
> > P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


RE: form validation question

2004-01-27 Thread Barnett, Brian W.
Your orderForm does extend ValidatorForm instead of ActionForm right? The
struts validator plug-in relies on your forms extending ValidatorForm in
order to do server-side validations.

Out of curiosity, you may want to see if client-side validation works first.


...



When the submit button is pressed, if the required field is empty, you
should get a message window indicating the field is required.

Brian Barnett


-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 1:16 PM
To: 'Struts Users Mailing List'
Subject: RE: form validation question

I see an empty page - no HTML, no nothing. It's as if the handoff to the
input path never happens, even though the logging informs me that validation
failed and the input path is being returned to. When you say 'a question of
display not working right', what do you have in mind? 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 3:05 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

What do you see in the source of the html page..? Maybe it is just a
question of display not working right..?

Geeta

Andy Kriger wrote:

> I am having a curious problem with form validation. I submit a form, 
> see in the logs that the form fails to validate, however, the webapp 
> does not return to the input page (I get a blank page with no HTML in 
> it), so I do not see the form with error messages as expected. If I 
> put text in the field, the form does submit correctly and I see the 
> JSP specified in the resulting action chain. The log files have no 
> error messages indicating something is amiss. When validation fails, 
> the subsequent action is definitely not running (I do not see the logging
in the execute method).
>
> Does anyone have any ideas what could be happening here?
> Or how I can track down the problem?
> Below is the relevant info...
>
> === STRUTS CONFIG ===
>
> 
>
>   type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/OrderForm.do"
>  scope="request">
>  
>
>  type="org.apache.struts.actions.ForwardAction"/>
>
> === orderForm.jsp ===
> 
> 
> <%=err%>
> 
> 
>
> 
> 
>  
>
> === VALIDATION CONFIG ===
> 
> 
> 
> 
> 
>
> === LOG MESSAGES ===
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validating input form properties
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validation failed, returning to '/OrderForm.do'
>
> Andy Kriger | Software Mechanic | Greater Than One, Inc.
> 28 West 27th Street | 7th Floor | New York, NY 10001
> P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question

2004-01-27 Thread Andy Kriger
I see an empty page - no HTML, no nothing. It's as if the handoff to the
input path never happens, even though the logging informs me that validation
failed and the input path is being returned to. When you say 'a question of
display not working right', what do you have in mind? 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 3:05 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

What do you see in the source of the html page..? Maybe it is just a
question of display not working right..?

Geeta

Andy Kriger wrote:

> I am having a curious problem with form validation. I submit a form, 
> see in the logs that the form fails to validate, however, the webapp 
> does not return to the input page (I get a blank page with no HTML in 
> it), so I do not see the form with error messages as expected. If I 
> put text in the field, the form does submit correctly and I see the 
> JSP specified in the resulting action chain. The log files have no 
> error messages indicating something is amiss. When validation fails, 
> the subsequent action is definitely not running (I do not see the logging
in the execute method).
>
> Does anyone have any ideas what could be happening here?
> Or how I can track down the problem?
> Below is the relevant info...
>
> === STRUTS CONFIG ===
>
> 
>
>   type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/OrderForm.do"
>  scope="request">
>  
>
>  type="org.apache.struts.actions.ForwardAction"/>
>
> === orderForm.jsp ===
> 
> 
> <%=err%>
> 
> 
>
> 
> 
>  
>
> === VALIDATION CONFIG ===
> 
> 
> 
> 
> 
>
> === LOG MESSAGES ===
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validating input form properties
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validation failed, returning to '/OrderForm.do'
>
> Andy Kriger | Software Mechanic | Greater Than One, Inc.
> 28 West 27th Street | 7th Floor | New York, NY 10001
> P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question

2004-01-27 Thread Geeta Ramani
Andy:

What do you see in the source of the html page..? Maybe it is just a question
of display not working right..?

Geeta

Andy Kriger wrote:

> I am having a curious problem with form validation. I submit a form, see in
> the logs that the form fails to validate, however, the webapp does not
> return to the input page (I get a blank page with no HTML in it), so I do
> not see the form with error messages as expected. If I put text in the
> field, the form does submit correctly and I see the JSP specified in the
> resulting action chain. The log files have no error messages indicating
> something is amiss. When validation fails, the subsequent action is
> definitely not running (I do not see the logging in the execute method).
>
> Does anyone have any ideas what could be happening here?
> Or how I can track down the problem?
> Below is the relevant info...
>
> === STRUTS CONFIG ===
>
> 
>
>   type="MyClass"
>  name="orderForm"
>  validate="true"
>  input="/OrderForm.do"
>  scope="request">
> 
> 
>
>  type="org.apache.struts.actions.ForwardAction"/>
>
> === orderForm.jsp ===
> 
> 
> <%=err%>
> 
> 
>
> 
> 
> 
> 
>
> === VALIDATION CONFIG ===
> 
> 
> 
> 
> 
>
> === LOG MESSAGES ===
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validating input form properties
> [org.apache.struts.action.RequestProcessor][RequestProcessor]
> Validation failed, returning to '/OrderForm.do'
>
> Andy Kriger | Software Mechanic | Greater Than One, Inc.
> 28 West 27th Street | 7th Floor | New York, NY 10001
> P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]


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



RE: form validation question

2003-03-21 Thread Marco Tedone
The values specified in the  are used by the validator as a
replacement for the generic pattern {0}. If you give a closer look to the
properties you should import(unless you won't specify yours) when using the
validator, one of these will be:

{0} is required

What the  causes is actually the value in the {0} to be replaced
by what you specify. So in your case you should see something similar to the
following:

phone(value from bundle) phone.ext(value from bundle) required

or 

phone.ext(value from bundle) required

Marco

> -Original Message-
> From: Andy Kriger [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 20, 2003 11:06 PM
> To: Struts Users Mailing List
> Subject: form validation question
> 
> 
> I have a validation rule that looks like this...
> 
>depends="mask">
>   
>   
>   
>   mask
>   ^\s*\d*\s*$
>   
> 
> 
> However, it considers the phoneExt field required. Can anyone 
> tell me why? I want the phoneExt field to be optional, and if 
> filled out, to use the given mask.
> 
> thx
> andy
> 
> 

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



Re: form validation question

2003-03-20 Thread Dan Allen

Andy Kriger ([EMAIL PROTECTED]) wrote:

> I have a validation rule that looks like this...
> 
>depends="mask">
>   
>   
>   
>   mask
>   ^\s*\d*\s*$
>   
> 
> 
> However, it considers the phoneExt field required. Can anyone tell me why?
> I want the phoneExt field to be optional, and if filled out, to use the
> given mask.
I believe this has been answered several times and that you just
need the newest validation-rules.xml file which makes mask optional
if not filled in, and leave the required up to the
depends="required,mask"

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"The package said 'Windows 95 or better', so I installed Linux"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



RE: Form Validation Question

2002-04-05 Thread David . A . Ventimiglia

Thanks!

-Original Message-
From: Ady Das-O'Toole [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 05, 2002 12:51 PM
To: Struts Users Mailing List
Subject: RE: Form Validation Question

You can also set validate=false in your mapping, but call the form's
validate method in your Action, that way you get to decide when to turn
validation on. Of course there's the additional hit of going to the action
every time, in this case.

Ady

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question


How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both "adding" and "editing" an entity.
The mapping looks like this:





  





The idea is, if we come into ../editAuthorityLevel from a link that says
"Add Authority Level", then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says "Edit Authority Level", then the
form fields (especially "authorityLevelId") will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
"Add Authority Level" link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's "edit" form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)






--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.



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


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

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




RE: Form Validation Question

2002-04-05 Thread Zeltser, Mark

You can turn off validation by specifying validate="false" in your action: 



 
   



 
   

Mark


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: RE: Form Validation Question


I would, except I don't know how to turn validation off in the Action
Mapping in struts-config.xml.  As long as I use the same ActionForm for both
"show me a blank form so I can add" and "show me a populated form so I can
edit", and that ActionForm implements validate(), then there's validation.
Is there a way to turn this off?

The alternative, which may not be so bad, is for the validate() method to
inspect the form fields and to decide to actually check for empty fields if
we're in "show me a populated form so I can edit" mode.  Actually, that's
not bad at all because it fits with the overall semantics.

In other words, I was originally thinking the validation rule is:

"The Authentication Level's 'Name' field may not be empty."

But upon further reflection, it's clear the validation rule is really:

"The Authentication Level's 'Name' field may not be empty, UNLESS this is
the special case of the 'Insert Row'."

Where 'Insert Row' is defined to be a bean whose primary key (eg.,
authenticationLevelId) is null.

Cheers,
David

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 12:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question

How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both "adding" and "editing" an entity.
The mapping looks like this:





  





The idea is, if we come into ../editAuthorityLevel from a link that says
"Add Authority Level", then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says "Edit Authority Level", then the
form fields (especially "authorityLevelId") will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
"Add Authority Level" link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's "edit" form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)






--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.



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

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



--
This message is intended only for the personal and con

RE: Form Validation Question

2002-04-05 Thread David . A . Ventimiglia

I would, except I don't know how to turn validation off in the Action
Mapping in struts-config.xml.  As long as I use the same ActionForm for both
"show me a blank form so I can add" and "show me a populated form so I can
edit", and that ActionForm implements validate(), then there's validation.
Is there a way to turn this off?

The alternative, which may not be so bad, is for the validate() method to
inspect the form fields and to decide to actually check for empty fields if
we're in "show me a populated form so I can edit" mode.  Actually, that's
not bad at all because it fits with the overall semantics.

In other words, I was originally thinking the validation rule is:

"The Authentication Level's 'Name' field may not be empty."

But upon further reflection, it's clear the validation rule is really:

"The Authentication Level's 'Name' field may not be empty, UNLESS this is
the special case of the 'Insert Row'."

Where 'Insert Row' is defined to be a bean whose primary key (eg.,
authenticationLevelId) is null.

Cheers,
David

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 05, 2002 12:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question

How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both "adding" and "editing" an entity.
The mapping looks like this:





  





The idea is, if we come into ../editAuthorityLevel from a link that says
"Add Authority Level", then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says "Edit Authority Level", then the
form fields (especially "authorityLevelId") will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
"Add Authority Level" link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's "edit" form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)






--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.



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

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




RE: Form Validation Question

2002-04-05 Thread Ady Das-O'Toole

You can also set validate=false in your mapping, but call the form's validate method 
in your Action, that way you get to decide when to turn validation on. Of course 
there's the additional hit of going to the action every time, in this case.

Ady

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question


How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both "adding" and "editing" an entity.
The mapping looks like this:





  





The idea is, if we come into ../editAuthorityLevel from a link that says
"Add Authority Level", then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says "Edit Authority Level", then the
form fields (especially "authorityLevelId") will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
"Add Authority Level" link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's "edit" form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)





--
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.



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


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




RE: Form Validation Question

2002-04-05 Thread Zeltser, Mark

How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both "adding" and "editing" an entity.
The mapping looks like this:





  





The idea is, if we come into ../editAuthorityLevel from a link that says
"Add Authority Level", then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says "Edit Authority Level", then the
form fields (especially "authorityLevelId") will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
"Add Authority Level" link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's "edit" form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)





--
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Form Validation Question

2001-10-01 Thread David Winterfeldt

You can put in any url in the input attribute.  So
there isn't a problem having input go through an
action.

David

--- "DEHAMER,BRIAN (HP-MountainView,ex1)"
<[EMAIL PROTECTED]> wrote:
> If I want to use form validation with my ActionForm
> bean, what should I
> specify for the "input" attribute of my action
> defition?  Should it
> reference the JSP page that renders the form (e.g.
> "/login.jsp") or should
> it reference the action responsible for presenting
> the form (e.g.
> "/login.do")?
> 
> All of the examples that I've seen show the "input"
> attribute pointing to
> the JSP page; however, when I do this I notice that
> my page doesn't render
> properly because it is dependent on some information
> that is set in the
> associated action class.  If I put an action path in
> the "input" attribute I
> think I can solve my problem, but I'm not sure if
> this is an appropriate use
> of the architecture.  
> 
> Thanks for the help.
> 
> Brian DeHamer
> Hewlett-Packard Co.
> [EMAIL PROTECTED]


__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com