AW: SV: Form Validation

2004-03-15 Thread Andreas Solarik
Hi guys!

Just something I believe to be true:

Aren't most systems compromised by incorrect configuration? I believe the
second most common weakness must be the postponement of patches to buggy
software -> see for example the whole alphabet of worms working their way
through IIS and Outlook Express... The problems have been addressed and
resolved by Microsoft, but many people fail to update their software.

Having an intruder launch a brute-force attack will only happen *if* you
keep your system current and locked down.

And Cristoph, I agree with you. I didn't doublecheck the numbers, but a
brute force attack only gains meaningfull information by knowing the *max*
string length, and by knowing of characters that are excluded from the
mystery string. And assuming that one authentication attempt takes 3
seconds, the average guessing time for the 4 letter password is roughly a
week...
And the solution space for the function increases exponentially with
increasing string lengths...

So, assuming that your passwords are not contained in a 'dictionary', and
assuming that your system is current, you have little to fear. You do check
your logs occasionally, right?

Andreas

-Ursprungliche Nachricht-
Von: Christoph Kutzinski [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 14:48
An: Struts Users Mailing List
Betreff: Re: SV: Form Validation


Max Cooper wrote:

> If the hacker thinks that 7 character passwords may be allowed, they might
> waste a considerable amount of time trying all 1-to-7 character
> combinations. If you tell them the minimum is 8 chars, they can save a lot
> of time by not trying those shorter passwords.

I still can't see that the point here.
If we have say only 26 characters and a minimum password length of 4
characters:

You have 26^4 variations for 4-char passwords = 456976
The cracker would just save
26 + 26^2 + 26^3 = 18278 variations if he knows that the min length is
4. That is nothing in comparison to the variations for 4 character alone.

If we have more characters, the differences are even bigger.

> Also, if the minimum length is really long (>8 chars), the hacker might
> guess that most people will use a password of that minimum length, and
might
> start trying words that are that length since people would be likely to
> choose something like that to meet the length requirement while still
being
> memorable.
>
> However, if your app allows people to register online, the hacker can
> probably find out the minimum password length anyway, so validating for
min
> password length on the login page for that kind of app would have little
> (i.e. hacker is not smart enough to try to register first to find out the
> minimum password length from the registration form) to no security
> consequences.

Agreed.


Christoph

>
> -Max
>
> - Original Message -
> From: "Christoph Kutzinski" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, March 15, 2004 5:06 AM
> Subject: Re: SV: Form Validation
>
>
>
>>Joe Hertz wrote:
>>
>>
>>>Check the Bugzilla. I believe it works in the  tag, but you
>>>won't get a javascript popup.
>>>
>>>If memory serves, there's a security concern about using minlength in
>>>password fields -- basically the logic goes something like, "Do you
>
> really
>
>>>want to be providing a front end validation that tells a cracker how
>
> long his
>
>>>randomly guessed password attempts must be".
>>
>>What should be the problem with this?
>>You are only telling him, how long they must be AT LEAST. Nothing about
>>how long the can be at most.
>>If you would say, it can be dangerous to expose the maxlength of the
>>password to the user then I could understand it. Though lots of sites do
>>exactely this in reality, so it cannot be such a big security danger.
>>
>>greets,
>>Christoph
>>
>>
>>-
>>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: SV: Form Validation

2004-03-15 Thread Christoph Kutzinski
Max Cooper wrote:

If the hacker thinks that 7 character passwords may be allowed, they might
waste a considerable amount of time trying all 1-to-7 character
combinations. If you tell them the minimum is 8 chars, they can save a lot
of time by not trying those shorter passwords.
I still can't see that the point here.
If we have say only 26 characters and a minimum password length of 4 
characters:

You have 26^4 variations for 4-char passwords = 456976
The cracker would just save
26 + 26^2 + 26^3 = 18278 variations if he knows that the min length is 
4. That is nothing in comparison to the variations for 4 character alone.

If we have more characters, the differences are even bigger.

Also, if the minimum length is really long (>8 chars), the hacker might
guess that most people will use a password of that minimum length, and might
start trying words that are that length since people would be likely to
choose something like that to meet the length requirement while still being
memorable.
However, if your app allows people to register online, the hacker can
probably find out the minimum password length anyway, so validating for min
password length on the login page for that kind of app would have little
(i.e. hacker is not smart enough to try to register first to find out the
minimum password length from the registration form) to no security
consequences.
Agreed.

Christoph

-Max

- Original Message - 
From: "Christoph Kutzinski" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, March 15, 2004 5:06 AM
Subject: Re: SV: Form Validation



Joe Hertz wrote:


Check the Bugzilla. I believe it works in the  tag, but you
won't get a javascript popup.
If memory serves, there's a security concern about using minlength in
password fields -- basically the logic goes something like, "Do you
really

want to be providing a front end validation that tells a cracker how
long his

randomly guessed password attempts must be".
What should be the problem with this?
You are only telling him, how long they must be AT LEAST. Nothing about
how long the can be at most.
If you would say, it can be dangerous to expose the maxlength of the
password to the user then I could understand it. Though lots of sites do
exactely this in reality, so it cannot be such a big security danger.
greets,
Christoph
-
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: SV: Form Validation

2004-03-15 Thread Jignesh
Ok Christophe,
Guide me what part of validation-rule.xml, I will modify to make it validate
clientside.

Jignesh Patel
 
Bang Software Technologies Pvt Ltd

[EMAIL PROTECTED]  

(O) 022 –28304761 Ext. 17
   022- 28343742 Ext. 17 

Software Technology Parks Of India(STPI)
Network Operation Centre
Plot No. AM-3 M.I.D.C Cross Road ‘A’,
Marol Industrial Area,
Andheri(E), Mumbai -93

Information contained in this transmission to the named addressee, including any
attachments thereto, should be considered the proprietary and confidential
information of the sender.  As a condition for viewing the information, the
sender agrees to keep the information confidential, to refrain from disclosing
the information, directly or indirectly, and to refrain from any actions that
would constitute or facilitate unauthorized access to the information without
express permission from the sender.   The recipient also acknowledges and agrees
to respect sender's intellectual property rights in and to the information.  If
the recipient of this transmission is not the named addressee, the recipient
should immediately notify the sender and destroy the information transmitted
without making any copy or distribution thereof. 

On Mon, 15 Mar 2004 14:06 , Christoph Kutzinski <[EMAIL PROTECTED]> sent:

>Joe Hertz wrote:
>
>> Check the Bugzilla. I believe it works in the  tag, but you 
>> won't get a javascript popup.
>> 
>> If memory serves, there's a security concern about using minlength in 
>> password fields -- basically the logic goes something like, "Do you really 
>> want to be providing a front end validation that tells a cracker how long his 
>> randomly guessed password attempts must be".
>
>What should be the problem with this?
>You are only telling him, how long they must be AT LEAST. Nothing about 
>how long the can be at most.
>If you would say, it can be dangerous to expose the maxlength of the 
>password to the user then I could understand it. Though lots of sites do 
>exactely this in reality, so it cannot be such a big security danger.
>
>greets,
>Christoph
>
>
>-
>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: SV: Form Validation

2004-03-15 Thread Max Cooper
If the hacker thinks that 7 character passwords may be allowed, they might
waste a considerable amount of time trying all 1-to-7 character
combinations. If you tell them the minimum is 8 chars, they can save a lot
of time by not trying those shorter passwords.

Also, if the minimum length is really long (>8 chars), the hacker might
guess that most people will use a password of that minimum length, and might
start trying words that are that length since people would be likely to
choose something like that to meet the length requirement while still being
memorable.

However, if your app allows people to register online, the hacker can
probably find out the minimum password length anyway, so validating for min
password length on the login page for that kind of app would have little
(i.e. hacker is not smart enough to try to register first to find out the
minimum password length from the registration form) to no security
consequences.

-Max

- Original Message - 
From: "Christoph Kutzinski" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, March 15, 2004 5:06 AM
Subject: Re: SV: Form Validation


> Joe Hertz wrote:
>
> > Check the Bugzilla. I believe it works in the  tag, but you
> > won't get a javascript popup.
> >
> > If memory serves, there's a security concern about using minlength in
> > password fields -- basically the logic goes something like, "Do you
really
> > want to be providing a front end validation that tells a cracker how
long his
> > randomly guessed password attempts must be".
>
> What should be the problem with this?
> You are only telling him, how long they must be AT LEAST. Nothing about
> how long the can be at most.
> If you would say, it can be dangerous to expose the maxlength of the
> password to the user then I could understand it. Though lots of sites do
> exactely this in reality, so it cannot be such a big security danger.
>
> greets,
> Christoph
>
>
> -
> 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: SV: Form Validation

2004-03-15 Thread Christoph Kutzinski
Joe Hertz wrote:

Check the Bugzilla. I believe it works in the  tag, but you 
won't get a javascript popup.

If memory serves, there's a security concern about using minlength in 
password fields -- basically the logic goes something like, "Do you really 
want to be providing a front end validation that tells a cracker how long his 
randomly guessed password attempts must be".
What should be the problem with this?
You are only telling him, how long they must be AT LEAST. Nothing about 
how long the can be at most.
If you would say, it can be dangerous to expose the maxlength of the 
password to the user then I could understand it. Though lots of sites do 
exactely this in reality, so it cannot be such a big security danger.

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


Re: SV: Form Validation

2004-03-15 Thread Jignesh Patel
Ok then what is the solution,
you mean to say I will handle through back end only.
Also in validation-rule.xml what I need to modify.

-Jignesh
On Monday 15 March 2004 16:32, Joe Hertz wrote:
> Check the Bugzilla. I believe it works in the  tag, but you
> won't get a javascript popup.
>
> If memory serves, there's a security concern about using minlength in
> password fields -- basically the logic goes something like, "Do you really
> want to be providing a front end validation that tells a cracker how long
> his randomly guessed password attempts must be".
>
> If you *really* want this though, you can just go ahead and modify the
> javascript you'll find in the validation-rules.xml file.
>
> > -Original Message-
> > From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 15, 2004 5:55 AM
> > To: Struts Users Mailing List
> > Subject: Re: SV: Form Validation
> >
> >
> > I am trying to use min length in javascript for password, but
> > it is not
> > working.
> > I am just wondering why it works for all the fields but not
> > password. Can I have any input.
> >
> > -Jignesh
> >
> > On Monday 15 March 2004 16:14, Nina Bertilsdotter wrote:
> > > Sorry, yes, it does extend ValidatorForm : )
> > >
> > > -Ursprungligt meddelande-
> > > Frï: Otto, Frank [mailto:[EMAIL PROTECTED]
> > > Skickat: den 15 mars 2004 11:41
> > > Till: 'Struts Users Mailing List'
> > > ïne: AW: Form Validation
> > >
> > > Does your form class extend the ValidatorForm?
> > >
> > > -Ursprngliche Nachricht-
> > > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > > Gesendet: Montag, 15. Mïz 2004 11:39
> > > An: 'Struts Users Mailing List'
> > > Betreff: SV: Form Validation
> > >
> > >
> > >
> > > Thanks Budi, but that didn't seem to do the trick either.  When I
> > > enter 4 (min range is 1900) in the "year" field I still
> >
> > don't get an
> >
> > > error.
> > >
> > > -Ursprungligt meddelande-
> > > Frï: Budi Rostiarso [mailto:[EMAIL PROTECTED]
> > > Skickat: den 15 mars 2004 11:31
> > > Till: Struts Users Mailing List
> > > ïne: RE: Form Validation
> > >
> > > Try putting max arg, because i think range validation must
> >
> > be supplied
> >
> > > with min and max (range) value.
> > >
> > > > > resource="false"/>
> > > > > resource="false"/>
> > >  
> > >min
> > >${minYear}
> > >  
> > >  
> > >max
> > >${maxYear}
> > >  
> > >
> > >
> > > CMIIW,
> > >
> > > bdr.
> > >
> > > -Original Message-
> > > From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, March 15, 2004 5:25 PM
> > > To: 'Struts Users Mailing List'
> > > Subject: SV: Form Validation
> > >
> > >
> > >
> > > Thank you, Frank, I was indeed missing the "validation='true'" but
> > > that didn't seem to fix my problem... must be something
> >
> > else; I guess
> >
> > > I've got to keep digging.
> > >
> > > Nina
> > >
> > > -Ursprungligt meddelande-
> > > Frï: Otto, Frank [mailto:[EMAIL PROTECTED]
> > > Skickat: den 15 mars 2004 11:13
> > > Till: 'Struts Users Mailing List'
> > > ïne: AW: Form Validation
> > >
> > > Hi Nina,
> > >
> > > you had to set validation="true" in your action definition
> > > (struts-config.xml).
> > >
> > >
> > > Regards,
> > >
> > > Frank
> > >
> > > -Ursprungliche Nachricht-
> > > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > > Gesendet: Montag, 15. Marz 2004 11:09
> > > An: 'Struts Users Mailing List'
> > > Betreff: Form Validation
> > >
> > >
> > > Hi People,
> > > I'm pulling my hair out trying to get form validation to
> >
> > work thr

Re: SV: AW: Form Validation

2004-03-15 Thread Jignesh Patel
OK I am giving working code map it with your app
1 .in Validation.xml  following code
 
  




minlength
5


   
mask
^[a-zA-Z]{1}[a-zA-Z0-9_]*$
   


maxlength
15

   

2. in Form class extend ValidatorForm

3. In struts-config file in action path for action-mapping

 




4. in index.jsp 

  

after body put


n last don't forget to use submit tage, if you are using html:img then it 
won't work.

On Monday 15 March 2004 16:32, Nina Bertilsdotter wrote:
> I'm not sure I understand what you mean
>
> -Ursprungligt meddelande-
> Från: Jignesh Patel [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 12:00
> Till: Struts Users Mailing List; Otto, Frank
> Ämne: Re: AW: Form Validation
>
> R u passing input value in struts-config.
> If implement as per mail say it has to work.
>
> On Monday 15 March 2004 16:23, Otto, Frank wrote:
> > I use ValidatorForm, but I think it's not the solution.
> >
> > -Ursprüngliche Nachricht-
> > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 15. März 2004 11:42
> > An: 'Struts Users Mailing List'
> > Betreff: SV: Form Validation
> >
> >
> >
> > No, it extends ValidatorActionForm.
> >
> > -Ursprungligt meddelande-----
> > Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> > Skickat: den 15 mars 2004 11:41
> > Till: 'Struts Users Mailing List'
> > Ämne: AW: Form Validation
> >
> > Does your form class extend the ValidatorForm?
> >
> > -Ursprüngliche Nachricht-
> > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 15. März 2004 11:39
> > An: 'Struts Users Mailing List'
> > Betreff: SV: Form Validation
> >
> >
> >
> > Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
> > (min range is 1900) in the "year" field I still don't get an error.
> >
> > -Ursprungligt meddelande-
> > Från: Budi Rostiarso [mailto:[EMAIL PROTECTED]
> > Skickat: den 15 mars 2004 11:31
> > Till: Struts Users Mailing List
> > Ämne: RE: Form Validation
> >
> > Try putting max arg, because i think range validation must be supplied
> > with min and max (range) value.
> >
> >   > resource="false"/>
> >   > resource="false"/>
> >  
> >min
> >    ${minYear}
> >  
> >  
> >max
> >${maxYear}
> >  
> >
> >
> > CMIIW,
> >
> > bdr.
> >
> > -Original Message-
> > From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 15, 2004 5:25 PM
> > To: 'Struts Users Mailing List'
> > Subject: SV: Form Validation
> >
> >
> >
> > Thank you, Frank, I was indeed missing the "validation='true'" but that
> > didn't seem to fix my problem... must be something else; I guess I've
> > got to
> > keep digging.
> >
> > Nina
> >
> > -----Ursprungligt meddelande-
> > Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> > Skickat: den 15 mars 2004 11:13
> > Till: 'Struts Users Mailing List'
> > Ämne: AW: Form Validation
> >
> > Hi Nina,
> >
> > you had to set validation="true" in your action definition
> > (struts-config.xml).
> >
> >
> > Regards,
> >
> > Frank
> >
> > -Ursprungliche Nachricht-
> > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 15. Marz 2004 11:09
> > An: 'Struts Users Mailing List'
> > Betreff: Form Validation
> >
> >
> > Hi People,
> > I'm pulling my hair out trying to get form validation to work through
> > the
> > validator, any help will be much appreciated.  In this example I'm
> > trying to
> > validate a single field ("year" of type int), should be pretty easy, one
> > might think, but alas, I'm stuck and I can't get it to work. I'm sure it
> > is
> > something simple but I've gone

SV: AW: Form Validation

2004-03-15 Thread Nina Bertilsdotter

I'm not sure I understand what you mean

-Ursprungligt meddelande-
Från: Jignesh Patel [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 12:00
Till: Struts Users Mailing List; Otto, Frank
Ämne: Re: AW: Form Validation

R u passing input value in struts-config.
If implement as per mail say it has to work.
On Monday 15 March 2004 16:23, Otto, Frank wrote:
> I use ValidatorForm, but I think it's not the solution.
>
> -Ursprüngliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. März 2004 11:42
> An: 'Struts Users Mailing List'
> Betreff: SV: Form Validation
>
>
>
> No, it extends ValidatorActionForm.
>
> -Ursprungligt meddelande-
> Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:41
> Till: 'Struts Users Mailing List'
> Ämne: AW: Form Validation
>
> Does your form class extend the ValidatorForm?
>
> -Ursprüngliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. März 2004 11:39
> An: 'Struts Users Mailing List'
> Betreff: SV: Form Validation
>
>
>
> Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
> (min range is 1900) in the "year" field I still don't get an error.
>
> -Ursprungligt meddelande-
> Från: Budi Rostiarso [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:31
> Till: Struts Users Mailing List
> Ämne: RE: Form Validation
>
> Try putting max arg, because i think range validation must be supplied
> with min and max (range) value.
>
> resource="false"/>
> resource="false"/>
>  
>min
>${minYear}
>  
>  
>max
>${maxYear}
>  
>
>
> CMIIW,
>
> bdr.
>
> -Original Message-
> From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 15, 2004 5:25 PM
> To: 'Struts Users Mailing List'
> Subject: SV: Form Validation
>
>
>
> Thank you, Frank, I was indeed missing the "validation='true'" but that
> didn't seem to fix my problem... must be something else; I guess I've
> got to
> keep digging.
>
> Nina
>
> -Ursprungligt meddelande-
> Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:13
> Till: 'Struts Users Mailing List'
> Ämne: AW: Form Validation
>
> Hi Nina,
>
> you had to set validation="true" in your action definition
> (struts-config.xml).
>
>
> Regards,
>
> Frank
>
> -Ursprungliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. Marz 2004 11:09
> An: 'Struts Users Mailing List'
> Betreff: Form Validation
>
>
> Hi People,
> I'm pulling my hair out trying to get form validation to work through
> the
> validator, any help will be much appreciated.  In this example I'm
> trying to
> validate a single field ("year" of type int), should be pretty easy, one
> might think, but alas, I'm stuck and I can't get it to work. I'm sure it
> is
> something simple but I've gone blind from looking at it. Thanks.
>
> JSP:
> 
> 
> 
>
> Struts-config:
>
> 
> 
> 
>type="packageName/MyAction"
>   scope="request"
>   name="myForm"
>   input="myPage.jsp ">
> 
> 
>
> Validation.xml:
>
> 
>   
> 
>  resource="false"/>
> 
> min
> 1900
> 
>
> 
>
>
>
>
> -
> 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 c

Re: SV: Form Validation

2004-03-15 Thread Joe Hertz
Check the Bugzilla. I believe it works in the  tag, but you 
won't get a javascript popup.

If memory serves, there's a security concern about using minlength in 
password fields -- basically the logic goes something like, "Do you really 
want to be providing a front end validation that tells a cracker how long his 
randomly guessed password attempts must be".

If you *really* want this though, you can just go ahead and modify the 
javascript you'll find in the validation-rules.xml file.


> -Original Message-
> From: Jignesh Patel [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 15, 2004 5:55 AM
> To: Struts Users Mailing List
> Subject: Re: SV: Form Validation
> 
> 
> I am trying to use min length in javascript for password, but 
> it is not 
> working.
> I am just wondering why it works for all the fields but not 
> password. Can I have any input.
> 
> -Jignesh
> 
> On Monday 15 March 2004 16:14, Nina Bertilsdotter wrote:
> > Sorry, yes, it does extend ValidatorForm : )
> >
> > -Ursprungligt meddelande-
> > Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> > Skickat: den 15 mars 2004 11:41
> > Till: 'Struts Users Mailing List'
> > Ämne: AW: Form Validation
> >
> > Does your form class extend the ValidatorForm?
> >
> > -Ursprüngliche Nachricht-
> > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 15. März 2004 11:39
> > An: 'Struts Users Mailing List'
> > Betreff: SV: Form Validation
> >
> >
> >
> > Thanks Budi, but that didn't seem to do the trick either.  When I 
> > enter 4 (min range is 1900) in the "year" field I still 
> don't get an 
> > error.
> >
> > -Ursprungligt meddelande-
> > Från: Budi Rostiarso [mailto:[EMAIL PROTECTED]
> > Skickat: den 15 mars 2004 11:31
> > Till: Struts Users Mailing List
> > Ämne: RE: Form Validation
> >
> > Try putting max arg, because i think range validation must 
> be supplied 
> > with min and max (range) value.
> >
> >   > resource="false"/>
> >   > resource="false"/>
> >  
> >min
> >${minYear}
> >  
> >  
> >max
> >${maxYear}
> >  
> >
> >
> > CMIIW,
> >
> > bdr.
> >
> > -Original Message-
> > From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 15, 2004 5:25 PM
> > To: 'Struts Users Mailing List'
> > Subject: SV: Form Validation
> >
> >
> >
> > Thank you, Frank, I was indeed missing the "validation='true'" but 
> > that didn't seem to fix my problem... must be something 
> else; I guess 
> > I've got to keep digging.
> >
> > Nina
> >
> > -Ursprungligt meddelande-
> > Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> > Skickat: den 15 mars 2004 11:13
> > Till: 'Struts Users Mailing List'
> > Ämne: AW: Form Validation
> >
> > Hi Nina,
> >
> > you had to set validation="true" in your action definition 
> > (struts-config.xml).
> >
> >
> > Regards,
> >
> > Frank
> >
> > -Ursprungliche Nachricht-
> > Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 15. Marz 2004 11:09
> > An: 'Struts Users Mailing List'
> > Betreff: Form Validation
> >
> >
> > Hi People,
> > I'm pulling my hair out trying to get form validation to 
> work through 
> > the validator, any help will be much appreciated.  In this 
> example I'm
> > trying to
> > validate a single field ("year" of type int), should be 
> pretty easy, one
> > might think, but alas, I'm stuck and I can't get it to 
> work. I'm sure it
> > is
> > something simple but I've gone blind from looking at it. Thanks.
> >
> > JSP:
> > 
> > 
> > 
> >
> > Struts-config:
> >
> > 
> >  
> >  >   type="packageName/MyAction"
> >   scope="request"
> >   name="myForm"
> >   input="myPage.jsp ">
> > 
> > 
> >
> > Validation.xml:
>

RE: Form Validation

2004-03-15 Thread Budi Rostiarso
Ok, next try...

i think it'll be because you haven't put the onsubmit javascript code on
the html:form tag?
something like 


and put this tag after the end of html:form:



also check if the generated html result have javascript code appended,
and the message resource does exist, including the key and value.


happy debugging :)



-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:45 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation


Sorry, yes, it does extend ValidatorForm : )

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:41
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Does your form class extend the ValidatorForm?

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:39
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



Thanks Budi, but that didn't seem to do the trick either.  When I enter
4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]

-
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]



SV: Form Validation

2004-03-15 Thread Nina Bertilsdotter

Yeah, I've tried both.  I use my form bean across several actions, that's
why I tie the validation to the action instead of the form bean. 

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:54
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

I use ValidatorForm, but I think it's not the solution.

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:42
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



No, it extends ValidatorActionForm.

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:41
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Does your form class extend the ValidatorForm?

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:39
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]

-
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: AW: Form Validation

2004-03-15 Thread Jignesh Patel
R u passing input value in struts-config.
If implement as per mail say it has to work.
On Monday 15 March 2004 16:23, Otto, Frank wrote:
> I use ValidatorForm, but I think it's not the solution.
>
> -Ursprüngliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. März 2004 11:42
> An: 'Struts Users Mailing List'
> Betreff: SV: Form Validation
>
>
>
> No, it extends ValidatorActionForm.
>
> -Ursprungligt meddelande-
> Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:41
> Till: 'Struts Users Mailing List'
> Ämne: AW: Form Validation
>
> Does your form class extend the ValidatorForm?
>
> -Ursprüngliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. März 2004 11:39
> An: 'Struts Users Mailing List'
> Betreff: SV: Form Validation
>
>
>
> Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
> (min range is 1900) in the "year" field I still don't get an error.
>
> -Ursprungligt meddelande-
> Från: Budi Rostiarso [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:31
> Till: Struts Users Mailing List
> Ämne: RE: Form Validation
>
> Try putting max arg, because i think range validation must be supplied
> with min and max (range) value.
>
> resource="false"/>
> resource="false"/>
>  
>min
>${minYear}
>  
>  
>max
>${maxYear}
>  
>
>
> CMIIW,
>
> bdr.
>
> -Original Message-
> From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 15, 2004 5:25 PM
> To: 'Struts Users Mailing List'
> Subject: SV: Form Validation
>
>
>
> Thank you, Frank, I was indeed missing the "validation='true'" but that
> didn't seem to fix my problem... must be something else; I guess I've
> got to
> keep digging.
>
> Nina
>
> -Ursprungligt meddelande-
> Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:13
> Till: 'Struts Users Mailing List'
> Ämne: AW: Form Validation
>
> Hi Nina,
>
> you had to set validation="true" in your action definition
> (struts-config.xml).
>
>
> Regards,
>
> Frank
>
> -Ursprungliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. Marz 2004 11:09
> An: 'Struts Users Mailing List'
> Betreff: Form Validation
>
>
> Hi People,
> I'm pulling my hair out trying to get form validation to work through
> the
> validator, any help will be much appreciated.  In this example I'm
> trying to
> validate a single field ("year" of type int), should be pretty easy, one
> might think, but alas, I'm stuck and I can't get it to work. I'm sure it
> is
> something simple but I've gone blind from looking at it. Thanks.
>
> JSP:
> 
> 
> 
>
> Struts-config:
>
> 
> 
> 
>type="packageName/MyAction"
>   scope="request"
>   name="myForm"
>   input="myPage.jsp ">
> 
> 
>
> Validation.xml:
>
> 
>   
> 
>  resource="false"/>
> 
> min
> 1900
> 
>
> 
>
>
>
>
> -
> 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]
>
> -
> 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]



AW: Form Validation

2004-03-15 Thread Otto, Frank
I use ValidatorForm, but I think it's not the solution.

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:42
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



No, it extends ValidatorActionForm.

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:41
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Does your form class extend the ValidatorForm?

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:39
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]

-
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: SV: Form Validation

2004-03-15 Thread Jignesh Patel
I am trying to use min length in javascript for password, but it is not 
working.
I am just wondering why it works for all the fields but not password.
Can I have any input.

-Jignesh

On Monday 15 March 2004 16:14, Nina Bertilsdotter wrote:
> Sorry, yes, it does extend ValidatorForm : )
>
> -Ursprungligt meddelande-
> Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:41
> Till: 'Struts Users Mailing List'
> Ämne: AW: Form Validation
>
> Does your form class extend the ValidatorForm?
>
> -Ursprüngliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. März 2004 11:39
> An: 'Struts Users Mailing List'
> Betreff: SV: Form Validation
>
>
>
> Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
> (min range is 1900) in the "year" field I still don't get an error.
>
> -Ursprungligt meddelande-
> Från: Budi Rostiarso [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:31
> Till: Struts Users Mailing List
> Ämne: RE: Form Validation
>
> Try putting max arg, because i think range validation must be supplied
> with min and max (range) value.
>
> resource="false"/>
> resource="false"/>
>  
>min
>${minYear}
>  
>  
>max
>${maxYear}
>  
>
>
> CMIIW,
>
> bdr.
>
> -Original Message-
> From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 15, 2004 5:25 PM
> To: 'Struts Users Mailing List'
> Subject: SV: Form Validation
>
>
>
> Thank you, Frank, I was indeed missing the "validation='true'" but that
> didn't seem to fix my problem... must be something else; I guess I've
> got to
> keep digging.
>
> Nina
>
> -Ursprungligt meddelande-
> Från: Otto, Frank [mailto:[EMAIL PROTECTED]
> Skickat: den 15 mars 2004 11:13
> Till: 'Struts Users Mailing List'
> Ämne: AW: Form Validation
>
> Hi Nina,
>
> you had to set validation="true" in your action definition
> (struts-config.xml).
>
>
> Regards,
>
> Frank
>
> -Ursprungliche Nachricht-
> Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 15. Marz 2004 11:09
> An: 'Struts Users Mailing List'
> Betreff: Form Validation
>
>
> Hi People,
> I'm pulling my hair out trying to get form validation to work through
> the
> validator, any help will be much appreciated.  In this example I'm
> trying to
> validate a single field ("year" of type int), should be pretty easy, one
> might think, but alas, I'm stuck and I can't get it to work. I'm sure it
> is
> something simple but I've gone blind from looking at it. Thanks.
>
> JSP:
> 
> 
> 
>
> Struts-config:
>
> 
> 
> 
>type="packageName/MyAction"
>   scope="request"
>   name="myForm"
>   input="myPage.jsp ">
> 
> 
>
> Validation.xml:
>
> 
>   
> 
>  resource="false"/>
> 
> min
> 1900
> 
>
> 
>
>
>
>
> -
> 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]
>
> -
> 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]



SV: Form Validation

2004-03-15 Thread Nina Bertilsdotter
Sorry, yes, it does extend ValidatorForm : )

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:41
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Does your form class extend the ValidatorForm?

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:39
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]

-
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]



SV: Form Validation

2004-03-15 Thread Nina Bertilsdotter

No, it extends ValidatorActionForm.

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:41
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Does your form class extend the ValidatorForm?

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:39
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]

-
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]



AW: Form Validation

2004-03-15 Thread Otto, Frank
Does your form class extend the ValidatorForm?

-Ursprüngliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 11:39
An: 'Struts Users Mailing List'
Betreff: SV: Form Validation



Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]

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



SV: Form Validation

2004-03-15 Thread Nina Bertilsdotter

Thanks Budi, but that didn't seem to do the trick either.  When I enter 4
(min range is 1900) in the "year" field I still don't get an error.

-Ursprungligt meddelande-
Från: Budi Rostiarso [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:31
Till: Struts Users Mailing List
Ämne: RE: Form Validation

Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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

2004-03-15 Thread Budi Rostiarso
Try putting max arg, because i think range validation must be supplied
with min and max (range) value.

 
 
 
   min
   ${minYear}
 
 
   max
   ${maxYear}
 


CMIIW,

bdr.

-Original Message-
From: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:25 PM
To: 'Struts Users Mailing List'
Subject: SV: Form Validation



Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've
got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through
the
validator, any help will be much appreciated.  In this example I'm
trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it
is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]



SV: Form Validation

2004-03-15 Thread Nina Bertilsdotter

Thank you, Frank, I was indeed missing the "validation='true'" but that
didn't seem to fix my problem... must be something else; I guess I've got to
keep digging.

Nina  

-Ursprungligt meddelande-
Från: Otto, Frank [mailto:[EMAIL PROTECTED] 
Skickat: den 15 mars 2004 11:13
Till: 'Struts Users Mailing List'
Ämne: AW: Form Validation

Hi Nina,

you had to set validation="true" in your action definition
(struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through the
validator, any help will be much appreciated.  In this example I'm trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

-
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]



AW: Form Validation

2004-03-15 Thread Otto, Frank
Hi Nina,

you had to set validation="true" in your action definition (struts-config.xml).


Regards,

Frank

-Ursprungliche Nachricht-
Von: Nina Bertilsdotter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. Marz 2004 11:09
An: 'Struts Users Mailing List'
Betreff: Form Validation


Hi People,
I'm pulling my hair out trying to get form validation to work through the
validator, any help will be much appreciated.  In this example I'm trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 

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



Form Validation

2004-03-15 Thread Nina Bertilsdotter
Hi People,
I'm pulling my hair out trying to get form validation to work through the
validator, any help will be much appreciated.  In this example I'm trying to
validate a single field ("year" of type int), should be pretty easy, one
might think, but alas, I'm stuck and I can't get it to work. I'm sure it is
something simple but I've gone blind from looking at it. Thanks.
 
JSP:



 
Struts-config:
 




 

 
Validation.xml:
 
 
  



min
1900



 
 
 


Re: Struts Form Validation

2004-03-08 Thread Niall Pemberton
You can specify a "indexedListProperty" in the validation.xml

 

 

Niall

- Original Message - 
From: "Rous, Simon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 08, 2004 1:54 PM
Subject: Struts Form Validation


> I'm letting the user of my form build up entry fields as they need them -
ie :
>
>  indexId="ctr" >
> 
> 
>
> giving form fields ...
>
> 
> 
> 
> etc ...
>
> How can I use validation.xml to validate these fields when I don't know if
a
> field exists on a page ?
>
>  
> 
>  
>  --- repeated for each field - but I don't know how many the user
will
> select 
>
> Maybe I should use the validate method inside the ActionForm and handle
these
> fields manually ?
>
> Thanks for any help.
>
> -Simon
>
>
>

==
> This message is for the sole use of the intended recipient. If you
received
> this message in error please delete it and notify us. If this message was
> misdirected, CSFB does not waive any confidentiality or privilege. CSFB
> retains and monitors electronic communications sent through its network.
> Instructions transmitted over this system are not binding on CSFB until
they
> are confirmed by us. Message transmission is not guaranteed to be secure.
>

==
>
>
> -
> 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]



Struts Form Validation

2004-03-08 Thread Rous, Simon
I'm letting the user of my form build up entry fields as they need them - ie :





giving form fields ...




etc ...

How can I use validation.xml to validate these fields when I don't know if a
field exists on a page ? 

 

 
 --- repeated for each field - but I don't know how many the user will
select 

Maybe I should use the validate method inside the ActionForm and handle these
fields manually ?

Thanks for any help.

-Simon


==
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==


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



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]



form validation question

2004-01-27 Thread Andy Kriger
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] 



Re: Form validation errors

2004-01-21 Thread sbruton
That was it, missing some JSTL TLD's. Thanks.

On Wed, Jan 21, 2004 at 02:24:27PM -0700, Richard Hightower wrote:
> Try this to see if it works:
> 
> 
>   
>   <%=error%>
>   
> 
> 
> If the above works, make sure you imported the right tld for core.
> Core has a JSTL EL tld (c.tld), and a runtime expression tld (crt.tld??)
> 
> Howsa 'bout showing your tablib import directive and your web.xml taglibs
> that you have declared too
> 
> 
> At least the above will spit the diff... i.e., let you know if the problem
> is with the JSP or the resource bundle.
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 21, 2004 1:34 PM
> To: [EMAIL PROTECTED]
> Subject: Form validation errors
> 
> 
> I am having trouble accessing messages from a resource bundle when form
> validation fails.
> 
> In a jar file under the WEB-INF/lib directory I have the following:
> 
> net/neospire/extranet/resources/Application.properties
> 
> inside the properties file I have the following:
> 
> errors.required={0} is required
> 
> and in my struts-config.xml I have:
> 
>  parameter="net.neospire.extranet.resources.Application"/>
> 
> however when I do the following in a JSP:
> 
> 
>   
>  
>   
> 
> 
> I just get "${error}" output once for each required field left blank
> instead of the message from the resource bundle.
> 
> --
> Sean Bruton   <[EMAIL PROTECTED]>
> Senior Engineer   Network Services
> NeoSpire, Inc.www.neospire.net
> 
> -
> 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]
> 
> 

-- 
Sean Bruton   <[EMAIL PROTECTED]>
Senior Engineer   Network Services
NeoSpire, Inc.www.neospire.net

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



RE: Form validation errors

2004-01-21 Thread Richard Hightower
Try this to see if it works:


  
<%=error%>
  


If the above works, make sure you imported the right tld for core.
Core has a JSTL EL tld (c.tld), and a runtime expression tld (crt.tld??)

Howsa 'bout showing your tablib import directive and your web.xml taglibs
that you have declared too


At least the above will spit the diff... i.e., let you know if the problem
is with the JSP or the resource bundle.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 1:34 PM
To: [EMAIL PROTECTED]
Subject: Form validation errors


I am having trouble accessing messages from a resource bundle when form
validation fails.

In a jar file under the WEB-INF/lib directory I have the following:

net/neospire/extranet/resources/Application.properties

inside the properties file I have the following:

errors.required={0} is required

and in my struts-config.xml I have:



however when I do the following in a JSP:


  
 
  


I just get "${error}" output once for each required field left blank
instead of the message from the resource bundle.

--
Sean Bruton   <[EMAIL PROTECTED]>
Senior Engineer   Network Services
NeoSpire, Inc.www.neospire.net

-
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 errors

2004-01-21 Thread sbruton
snafu,  seems to work...

On Wed, Jan 21, 2004 at 02:34:18PM -0600, [EMAIL PROTECTED] wrote:
> I am having trouble accessing messages from a resource bundle when form
> validation fails.
> 
> In a jar file under the WEB-INF/lib directory I have the following:
> 
> net/neospire/extranet/resources/Application.properties
> 
> inside the properties file I have the following:
> 
> errors.required={0} is required
> 
> and in my struts-config.xml I have:
> 
>  parameter="net.neospire.extranet.resources.Application"/>
> 
> however when I do the following in a JSP:
> 
> 
>   
>  
>   
> 
> 
> I just get "${error}" output once for each required field left blank
> instead of the message from the resource bundle.
> 
> -- 
> Sean Bruton   <[EMAIL PROTECTED]>
> Senior Engineer   Network Services
> NeoSpire, Inc.www.neospire.net
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
Sean Bruton   <[EMAIL PROTECTED]>
Senior Engineer   Network Services
NeoSpire, Inc.www.neospire.net

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



Form validation errors

2004-01-21 Thread sbruton
I am having trouble accessing messages from a resource bundle when form
validation fails.

In a jar file under the WEB-INF/lib directory I have the following:

net/neospire/extranet/resources/Application.properties

inside the properties file I have the following:

errors.required={0} is required

and in my struts-config.xml I have:



however when I do the following in a JSP:


  
 
  


I just get "${error}" output once for each required field left blank
instead of the message from the resource bundle.

-- 
Sean Bruton   <[EMAIL PROTECTED]>
Senior Engineer   Network Services
NeoSpire, Inc.www.neospire.net

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



Re: Blank page after form validation

2004-01-14 Thread Matt Raible
Most likely your "input" attribute is invalid - this usually results in 
a blank page in my experience.

HTH,

Matt

On Jan 13, 2004, at 10:56 PM, VENKATESH GANGAL wrote:

Hi All,

We have been facing a very strange problem with form validation

We have a JSP which is an input to an action and there is an 
associated form bean to validate the form.

Here is the configuaration file
struts-config.xml:





  



 

  
validation.xml :




   
   
   




MessageResources.properties
form.error.productRef = Please enter Product Reference
FormBean Validation method :

 public ActionErrors validate(ActionMapping mapping,HttpServletRequest 
request)
   {
	   //ActionErrors errors = super.validate(mapping, request);
	   ActionErrors errors = new ActionErrors();
		if ((productRef == null) || (productRef.trim().length()< 1)){
		errors.add ("productRef",new 
ActionError("form.error.productRef"));
		}
	
	   return errors ;
   }

Here is the JSP



	

 

  
   
  
		 
		
   
			
		

When I submit this form without entering anything in the textfield, it 
is taking me to a blank page.

Can anyone let me know why this is happening? It is not going to the 
action at all and is returning with errors to the JSP.I am not able to 
reach the page from where I submitted the data along with errors.The 
error was added to ActionErrors object.

We are using oc4j(Oracle Apps) standalone application.We are using 
struts 1.1

Thanks in advance for your help.

Cheers...
Venkatesh





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


Blank page after form validation

2004-01-13 Thread VENKATESH GANGAL
Hi All,

We have been facing a very strange problem with form validation

We have a JSP which is an input to an action and there is an associated form bean to 
validate the form.

Here is the configuaration file
struts-config.xml:


  





  





 

  

validation.xml :




   
   
   
 




MessageResources.properties
form.error.productRef = Please enter Product Reference

FormBean Validation method :

 public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) 
   {
   //ActionErrors errors = super.validate(mapping, request);
   ActionErrors errors = new ActionErrors();
if ((productRef == null) || (productRef.trim().length()< 1)){
errors.add ("productRef",new 
ActionError("form.error.productRef"));
}

   return errors ;
   }


Here is the JSP





 


  
   
  
 

   
   
 



When I submit this form without entering anything in the textfield, it is taking me to 
a blank page.

Can anyone let me know why this is happening? It is not going to the action at all and 
is returning with errors to the JSP.I am not able to reach the page from where I 
submitted the data along with errors.The error was added to ActionErrors object.

We are using oc4j(Oracle Apps) standalone application.We are using struts 1.1

Thanks in advance for your help.

Cheers...
Venkatesh






Re: setting up form validation

2003-12-11 Thread Mark Lowe
I think you work with my brother.

Sorry thats OT , mail me off the list and I'll take a look..

Cheers Mark

On 11 Dec 2003, at 13:41, Rupinder Singh Mazara wrote:

Hi All ,

Can some help me in getting in setting up validation for data in the
following format
2, 4, 5-9, 18, 21-25, 50
or 2, 90, 300
or 67-90, 101-210
for a textfield in html form

I have tried setting up a Regular expression to check for
/\s*(\d*-\d*,|\d*,)\s*/ occurrences but i cannot get on from here
I have tried doing it in a JavaScript as well as setting it up in a
validate method for my form , ( USING STRUTS )
thanks in advance

regards

-
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]


setting up form validation

2003-12-11 Thread Rupinder Singh Mazara

Hi All ,

Can some help me in getting in setting up validation for data in the
following format
2, 4, 5-9, 18, 21-25, 50
or 2, 90, 300
or 67-90, 101-210

for a textfield in html form

I have tried setting up a Regular expression to check for
/\s*(\d*-\d*,|\d*,)\s*/ occurrences but i cannot get on from here
I have tried doing it in a JavaScript as well as setting it up in a
validate method for my form , ( USING STRUTS )

thanks in advance

regards


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



State change before form validation

2003-11-25 Thread Tommy Holm - TELMORE
I am currently using the struts workflow extension and I have stumbled
upon some strange behaviour. When you on a jsp page with form and submit
that form, the workflow state changes before 
the validation result is taken into consideration. Please correct me if
I am wrong. This puzzles me because the idea of struts form beans are
that if validation fails, you are being returned to the same page you
originated from. That gives a problem because you then need to have a
previous state for your action that is the same as the newState,
otherwise you get a violation. Maybe I remember wrong but I seem to
remember seing an answer (from Matthias who is one of the developers of
the workflow extension) on the struts mailinglist that it's not a good
idea to have a previous state that is the same as the newState, didn't
understand why, so could anybody perhaps give a few comments on the
state being set before form validation 
Cheers and regards

Tommy Holm, System Udvikler
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 22582344
www.telmore.dk 


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



RE: Complex Form Validation

2003-11-18 Thread Yee, Richard K,,DMDCWEST
George,
You can't do the validation server-side as you proposed because the browser
only sends HTML form elements. It will not send any information regarding
the div tag. You would have to have a hidden form variable and use
JavaScript to populate it with any values of interest when the form is
submitted. 

Regards,

Richard

-Original Message-
From: George Steimer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 18, 2003 11:51 AM
To: Struts Users Mailing List
Subject: Re: Complex Form Validation


Nick,

Thanks for your response.  I'm doing something similar with javascript.
What would be better is if we could validate the form serverside with the
validation framework...  I think we would have to write a custom validator
that somehow would get the div parent of the form field and check that
before checking the actual field.

Thanks,

George

> 
> 
> 
> 
> 
> George,
> 
> I have done something similar to this.  I haven't looked at browser 
> compatability yet(we're currently using this with ie6), but the 
> concept that I use is that I look at the parents of the form field, 
> trying to find out if the element is hidden.  If I find that a parent 
> that is hidden, then I take appropriate action.
> 
> My javascript loop looks like this:
> 
> var hiddenParent = false;
> for(parent=formField.parentElement; parent != null && hiddenParent == 
> false; parent = parent.parentElement) {
>  if(parent.currentStyle.display == none) {
>   hiddenParent = true;
>  }
> }
> 
> if(hiddenParent) {
>  etc, etc
> }
> 
> Hope this helps a little.  If there are better ways to do this, I'd 
> love to get the feedback :-) Nick
> 
> 
> 
>

>   George Steimer

>   <[EMAIL PROTECTED]To:
[EMAIL PROTECTED]

>   m>   cc:

>Subject:  Complex Form
Validation   
>   11/18/2003 02:18

>   PM

>   Please respond to

>   "Struts Users

>   Mailing List"

>

>

> 
> 
> 
> 
> We are trying to perform some complex form validaion with the new 
> Validator plugin.  Here is what we are trying to do:
> 
> 1 -- validate a form field based on other form fields
> 2 -- validate a form field based on div style settings
> 
> I know that I could solve the first problem with the old validation 
> architecture, but is there a way to do that through the validator.xml?  
> I'm not sure about the second problem.  The code looks something like 
> this
> 
> 
> //my form element here
> 
> 
> So is it possible to only validate the form element above only if the 
> enclosing div display is block?  I've looked, but couldn't find 
> anything explaining how to go about this.  Any ideas?
> 
> Thanks in advance,
> 
> George
> 
> -
> 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: Complex Form Validation

2003-11-18 Thread George Steimer
Nick,

Thanks for your response.  I'm doing something similar with javascript.  What would be 
better is if we could validate the form serverside with the validation framework...  I 
think we would have to write a custom validator that somehow would get the div parent 
of the form field and check that before checking the actual field.

Thanks,

George

> 
> 
> 
> 
> 
> George,
> 
> I have done something similar to this.  I haven't looked at browser
> compatability yet(we're currently using this with ie6), but the concept
> that I use is that I look at the parents of the form field, trying to find
> out if the element is hidden.  If I find that a parent that is hidden, then
> I take appropriate action.
> 
> My javascript loop looks like this:
> 
> var hiddenParent = false;
> for(parent=formField.parentElement; parent != null && hiddenParent ==
> false; parent = parent.parentElement) {
>  if(parent.currentStyle.display == none) {
>   hiddenParent = true;
>  }
> }
> 
> if(hiddenParent) {
>  etc, etc
> }
> 
> Hope this helps a little.  If there are better ways to do this, I'd love to
> get the feedback :-)
> Nick
> 
> 
> 
>  
>   
>   George Steimer 
>   
>   <[EMAIL PROTECTED]To:   [EMAIL PROTECTED]  
>   
>   m>   cc:       
>   
>Subject:  Complex Form Validation 
>   
>   11/18/2003 02:18   
>   
>   PM 
>   
>   Please respond to  
>   
>   "Struts Users  
>   
>   Mailing List"  
>   
>  
>   
>  
>   
> 
> 
> 
> 
> We are trying to perform some complex form validaion with the new Validator
> plugin.  Here is what we are trying to do:
> 
> 1 -- validate a form field based on other form fields
> 2 -- validate a form field based on div style settings
> 
> I know that I could solve the first problem with the old validation
> architecture, but is there a way to do that through the validator.xml?  I'm
> not sure about the second problem.  The code looks something like this
> 
> 
> //my form element here
> 
> 
> So is it possible to only validate the form element above only if the
> enclosing div display is block?  I've looked, but couldn't find anything
> explaining how to go about this.  Any ideas?
> 
> Thanks in advance,
> 
> George
> 
> -
> 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: Complex Form Validation

2003-11-18 Thread Nicholas L Mohler





George,

I have done something similar to this.  I haven't looked at browser
compatability yet(we're currently using this with ie6), but the concept
that I use is that I look at the parents of the form field, trying to find
out if the element is hidden.  If I find that a parent that is hidden, then
I take appropriate action.

My javascript loop looks like this:

var hiddenParent = false;
for(parent=formField.parentElement; parent != null && hiddenParent ==
false; parent = parent.parentElement) {
 if(parent.currentStyle.display == none) {
  hiddenParent = true;
 }
}

if(hiddenParent) {
 etc, etc
}

Hope this helps a little.  If there are better ways to do this, I'd love to
get the feedback :-)
Nick



   

  George Steimer   

  <[EMAIL PROTECTED]To:   [EMAIL PROTECTED]

  m>   cc: 

   Subject:  Complex Form Validation   

  11/18/2003 02:18 

  PM   

  Please respond to

  "Struts Users

  Mailing List"

   

   





We are trying to perform some complex form validaion with the new Validator
plugin.  Here is what we are trying to do:

1 -- validate a form field based on other form fields
2 -- validate a form field based on div style settings

I know that I could solve the first problem with the old validation
architecture, but is there a way to do that through the validator.xml?  I'm
not sure about the second problem.  The code looks something like this


//my form element here


So is it possible to only validate the form element above only if the
enclosing div display is block?  I've looked, but couldn't find anything
explaining how to go about this.  Any ideas?

Thanks in advance,

George

-
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]



Complex Form Validation

2003-11-18 Thread George Steimer
We are trying to perform some complex form validaion with the new Validator plugin.  
Here is what we are trying to do:

1 -- validate a form field based on other form fields
2 -- validate a form field based on div style settings

I know that I could solve the first problem with the old validation architecture, but 
is there a way to do that through the validator.xml?  I'm not sure about the second 
problem.  The code looks something like this


//my form element here


So is it possible to only validate the form element above only if the enclosing div 
display is block?  I've looked, but couldn't find anything explaining how to go about 
this.  Any ideas?

Thanks in advance,

George

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



Re: Reg: Dyna Form Validation - Filed match

2003-09-05 Thread Mike Kienenberger
Raj Atchutuni <[EMAIL PROTECTED]> wrote:
> Does any one have validation rule to match two fileds. Like PASSWORD, 
CONFIRM PASSWORD on the form. If both are not the same display error.

http://jakarta.apache.org/struts/userGuide/dev_validator.html#plugs

Scroll to "Comparing Two Fields"

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



Re: Reg: Dyna Form Validation - Filed match

2003-09-05 Thread Adam Hardy
Somebody else asked that last week - check the archives, I don't have it 
off the top of my head.

Actually it might be in the apachewiki - and if it isn't, it should be.

Adam

On 09/05/2003 03:44 PM Raj Atchutuni wrote:
Does any one have validation rule to match two fileds. Like PASSWORD, CONFIRM PASSWORD 
on the form. If both are not the same display error.
Thanks
Raj
-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reg: Dyna Form Validation - Filed match

2003-09-05 Thread Raj Atchutuni
Does any one have validation rule to match two fileds. Like PASSWORD, CONFIRM PASSWORD 
on the form. If both are not the same display error.
Thanks
Raj


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Robert Leland
Greg Amaroso wrote:

I currently have Struts 1.1. Is the checkbox/radio update available in the
most current nightly build?
 

Yes. Even though it contains a commons-validator dated from August 16 th.

Also, should the form-property type be "boolean" or "java.lang.Boolean"
(case-sensitive of course)?
Thanks.


 

From: "Mathew, Manoj" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Date: Thu, 4 Sep 2003 08:48:19 -0500
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Struts form validation of radio buttons and checkboxes
YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN
HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION WE
WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE IT
"FALSE"
ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
getCheckbox():return String  in your action form.
-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 7:48 AM
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes
Thanks for the response, but I don't think the problem lies with the actual
validation that's happening.
I suspect that when a user submits the form page without a checkbox/radio
button checked, a blank variable is never sent to the form bean (i.e
http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
The form bean then sees it as as a nonexistent variable and returns a trace
stack error. Any other ideas?
I will however update my struts package.


   

From: Robert Leland <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Date: Wed, 03 Sep 2003 22:09:14 -0400
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Struts form validation of radio buttons and checkboxes
Greg Amaroso wrote:

 

I'm having trouble with the struts form validation framework when it comes
to radio buttons and checkboxes. For some reason, I can validate any other
type of field, but not radios/checkboxes. Here's where I seem to be having
trouble: 

   

Try a --nightly-- build of struts. I believe it has enhancements in
commons-validator to validate
radio controls. you can tell for sure by looking at the validator-rules.xml.
In there you'll see itels like :
 function validateRequired(form) {
   
//Stuff deleted.
   
 if (field.type == 'text' ||
 //stuff deleted
 field.type == 'radio' ||
 field.type == 'password') {

So this says that for the 'required' rule radio is supported.

Do the same for integer, byte, etc to see if 'radio' is supported.

 

In the struts-config.xml file, should the form-property type be set to
java.lang.String or java.lang.Boolean?
In the page with the form, does it look right to create the radio buttons
like this:





Are there any other tricks to doing this that differs from validating
standard text boxes, textareas, etc.?
Thank in advance.

Greg Amaroso



   



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


Re: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Robert Leland
Mathew, Manoj wrote:

YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. 

Did you file a Bugzilla bug report ? If not could you file a Bugilla 
report, attaching a detailed description and/or
test case is the best way to get this fixed.

Thanks

IN OUR APPLICATION WE WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE IT "FALSE"

ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if getCheckbox():return String  in your action form.

-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 7:48 AM
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes
Thanks for the response, but I don't think the problem lies with the actual
validation that's happening.
I suspect that when a user submits the form page without a checkbox/radio
button checked, a blank variable is never sent to the form bean (i.e
http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
The form bean then sees it as as a nonexistent variable and returns a trace
stack error. Any other ideas?
I will however update my struts package.


 

From: Robert Leland <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Date: Wed, 03 Sep 2003 22:09:14 -0400
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Struts form validation of radio buttons and checkboxes
Greg Amaroso wrote:

   

I'm having trouble with the struts form validation framework when it comes
to radio buttons and checkboxes. For some reason, I can validate any other
type of field, but not radios/checkboxes. Here's where I seem to be having
trouble: 

 

Try a --nightly-- build of struts. I believe it has enhancements in
commons-validator to validate
radio controls. you can tell for sure by looking at the validator-rules.xml.
In there you'll see itels like :
 function validateRequired(form) {
   
//Stuff deleted.

 if (field.type == 'text' ||
 //stuff deleted
 field.type == 'radio' ||
 field.type == 'password') {

So this says that for the 'required' rule radio is supported.

Do the same for integer, byte, etc to see if 'radio' is supported.

   

In the struts-config.xml file, should the form-property type be set to
java.lang.String or java.lang.Boolean?
In the page with the form, does it look right to create the radio buttons
like this:





Are there any other tricks to doing this that differs from validating
standard text boxes, textareas, etc.?
Thank in advance.

Greg Amaroso

 



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


RE: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Mathew, Manoj
As Hill said it is not the issue with the struts but with the HTML. SO i don't think 
it has to do anything with the version of struts you are using.

type is boolean ( primitive)..  not Boolean.

thanks

-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 9:00 AM
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes


I currently have Struts 1.1. Is the checkbox/radio update available in the
most current nightly build?
Also, should the form-property type be "boolean" or "java.lang.Boolean"
(case-sensitive of course)?
Thanks.



> From: "Mathew, Manoj" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Thu, 4 Sep 2003 08:48:19 -0500
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: RE: Struts form validation of radio buttons and checkboxes
> 
> YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN
> HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION WE
> WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE IT
> "FALSE"
> 
> ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
> getCheckbox():return String  in your action form.
> 
> -Original Message-
> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 7:48 AM
> To: Struts Users Mailing List
> Subject: Re: Struts form validation of radio buttons and checkboxes
> 
> 
> Thanks for the response, but I don't think the problem lies with the actual
> validation that's happening.
> I suspect that when a user submits the form page without a checkbox/radio
> button checked, a blank variable is never sent to the form bean (i.e
> http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
> The form bean then sees it as as a nonexistent variable and returns a trace
> stack error. Any other ideas?
> I will however update my struts package.
> 
> 
> 
>> From: Robert Leland <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Date: Wed, 03 Sep 2003 22:09:14 -0400
>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>> Subject: Re: Struts form validation of radio buttons and checkboxes
>> 
>> Greg Amaroso wrote:
>> 
>>> I'm having trouble with the struts form validation framework when it comes
>>> to radio buttons and checkboxes. For some reason, I can validate any other
>>> type of field, but not radios/checkboxes. Here's where I seem to be having
>>> trouble: 
>>>  
>>> 
>> Try a --nightly-- build of struts. I believe it has enhancements in
>> commons-validator to validate
>> radio controls. you can tell for sure by looking at the validator-rules.xml.
>> 
>> In there you'll see itels like :
>>   function validateRequired(form) {
>> 
>> //Stuff deleted.
>> 
>>   if (field.type == 'text' ||
>>   //stuff deleted
>>   field.type == 'radio' ||
>>   field.type == 'password') {
>> 
>> So this says that for the 'required' rule radio is supported.
>> 
>> Do the same for integer, byte, etc to see if 'radio' is supported.
>> 
>>> In the struts-config.xml file, should the form-property type be set to
>>> java.lang.String or java.lang.Boolean?
>>> 
>>> In the page with the form, does it look right to create the radio buttons
>>> like this:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Are there any other tricks to doing this that differs from validating
>>> standard text boxes, textareas, etc.?
>>> 
>>> Thank in advance.
>>> 
>>> 
>>> Greg Amaroso
>>> 
>>>  
>>> 
>> 
>> 
>> 
>> -
>> 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]


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



RE: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Andrew Hill

don't understand why I want to reset the checkboxes to their unticked value.


Im in a hurry to get home (taxi fare doubles after midnight!) so dont have
time to explain in detail, but if you check the javadocs for the reset()
method and search the mail list archive you should be able to find the info
you need :-) (This question is a regular one!)

Mind you, if your form is request scoped it would implicitly be 'reset' as
you are getting a new form instance each time. Hmm. Have you perchance set
the default value for the checkbox to be ticked or is this a session scoped
form?

-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, 4 September 2003 23:03
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes


No, I haven't implemented it yet. But I must plead ignorance here, because I
don't understand why I want to reset the checkboxes to their unticked value.
If I'm submitting the form essentially back to itself, what does the
unticked value do for me? Or am I missing something?

As for the radio buttons, making the first one already selected is my out
with that. I only included them in this discussion because they
fundamentally work in the same way as checkboxes (i.e. they don't send
variables if not checked).

Thanks.

Greg



> From: "Andrew Hill" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Thu, 4 Sep 2003 22:38:19 +0800
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: RE: Struts form validation of radio buttons and checkboxes
>
> Have you implemented code in reset() to reset the checkbox to its unticked
> value in the form yet?
>
> Not sure why radio buttons would give you problems though.
> They usually have one option selected which would get submitted.
>
>
> -Original Message-
> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 4 September 2003 22:00
> To: Struts Users Mailing List
> Subject: Re: Struts form validation of radio buttons and checkboxes
>
>
> I currently have Struts 1.1. Is the checkbox/radio update available in the
> most current nightly build?
> Also, should the form-property type be "boolean" or "java.lang.Boolean"
> (case-sensitive of course)?
> Thanks.
>
>
>
>> From: "Mathew, Manoj" <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Date: Thu, 4 Sep 2003 08:48:19 -0500
>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Subject: RE: Struts form validation of radio buttons and checkboxes
>>
>> YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT
EVEN
>> HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION
> WE
>> WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE
> IT
>> "FALSE"
>>
>> ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
>> getCheckbox():return String  in your action form.
>>
>> -Original Message-
>> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, September 04, 2003 7:48 AM
>> To: Struts Users Mailing List
>> Subject: Re: Struts form validation of radio buttons and checkboxes
>>
>>
>> Thanks for the response, but I don't think the problem lies with the
> actual
>> validation that's happening.
>> I suspect that when a user submits the form page without a checkbox/radio
>> button checked, a blank variable is never sent to the form bean (i.e
>> http://www.url.com/servlet.do?checkboxvar=), it just doesn't send
> anything.
>> The form bean then sees it as as a nonexistent variable and returns a
> trace
>> stack error. Any other ideas?
>> I will however update my struts package.
>>
>>
>>
>>> From: Robert Leland <[EMAIL PROTECTED]>
>>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>> Date: Wed, 03 Sep 2003 22:09:14 -0400
>>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>>> Subject: Re: Struts form validation of radio buttons and checkboxes
>>>
>>> Greg Amaroso wrote:
>>>
>>>> I'm having trouble with the struts form validation framework when it
> comes
>>>> to radio buttons and checkboxes. For some reason, I can validate any
> other
>>>> type of field, but not radios/checkboxes. Here's where I seem to be
> having
>>>> trouble:
>>>>
>>>>
>>> Try a --nightly-- build of struts. I believe it has enhanceme

Re: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Greg Amaroso
No, I haven't implemented it yet. But I must plead ignorance here, because I
don't understand why I want to reset the checkboxes to their unticked value.
If I'm submitting the form essentially back to itself, what does the
unticked value do for me? Or am I missing something?

As for the radio buttons, making the first one already selected is my out
with that. I only included them in this discussion because they
fundamentally work in the same way as checkboxes (i.e. they don't send
variables if not checked).

Thanks.

Greg



> From: "Andrew Hill" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Thu, 4 Sep 2003 22:38:19 +0800
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: RE: Struts form validation of radio buttons and checkboxes
> 
> Have you implemented code in reset() to reset the checkbox to its unticked
> value in the form yet?
> 
> Not sure why radio buttons would give you problems though.
> They usually have one option selected which would get submitted.
> 
> 
> -Original Message-
> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 4 September 2003 22:00
> To: Struts Users Mailing List
> Subject: Re: Struts form validation of radio buttons and checkboxes
> 
> 
> I currently have Struts 1.1. Is the checkbox/radio update available in the
> most current nightly build?
> Also, should the form-property type be "boolean" or "java.lang.Boolean"
> (case-sensitive of course)?
> Thanks.
> 
> 
> 
>> From: "Mathew, Manoj" <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Date: Thu, 4 Sep 2003 08:48:19 -0500
>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Subject: RE: Struts form validation of radio buttons and checkboxes
>> 
>> YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN
>> HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION
> WE
>> WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE
> IT
>> "FALSE"
>> 
>> ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
>> getCheckbox():return String  in your action form.
>> 
>> -Original Message-
>> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, September 04, 2003 7:48 AM
>> To: Struts Users Mailing List
>> Subject: Re: Struts form validation of radio buttons and checkboxes
>> 
>> 
>> Thanks for the response, but I don't think the problem lies with the
> actual
>> validation that's happening.
>> I suspect that when a user submits the form page without a checkbox/radio
>> button checked, a blank variable is never sent to the form bean (i.e
>> http://www.url.com/servlet.do?checkboxvar=), it just doesn't send
> anything.
>> The form bean then sees it as as a nonexistent variable and returns a
> trace
>> stack error. Any other ideas?
>> I will however update my struts package.
>> 
>> 
>> 
>>> From: Robert Leland <[EMAIL PROTECTED]>
>>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>> Date: Wed, 03 Sep 2003 22:09:14 -0400
>>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>>> Subject: Re: Struts form validation of radio buttons and checkboxes
>>> 
>>> Greg Amaroso wrote:
>>> 
>>>> I'm having trouble with the struts form validation framework when it
> comes
>>>> to radio buttons and checkboxes. For some reason, I can validate any
> other
>>>> type of field, but not radios/checkboxes. Here's where I seem to be
> having
>>>> trouble:
>>>> 
>>>> 
>>> Try a --nightly-- build of struts. I believe it has enhancements in
>>> commons-validator to validate
>>> radio controls. you can tell for sure by looking at the
> validator-rules.xml.
>>> 
>>> In there you'll see itels like :
>>>   function validateRequired(form) {
>>> 
>>> //Stuff deleted.
>>> 
>>>   if (field.type == 'text' ||
>>>   //stuff deleted
>>>   field.type == 'radio' ||
>>>   field.type == 'password') {
>>> 
>>> So this says that for the 'required' rule radio is supported.
>>> 
>>> Do the same for integer, byte, etc to see if '

RE: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Andrew Hill
Have you implemented code in reset() to reset the checkbox to its unticked
value in the form yet?

Not sure why radio buttons would give you problems though.
They usually have one option selected which would get submitted.


-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, 4 September 2003 22:00
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes


I currently have Struts 1.1. Is the checkbox/radio update available in the
most current nightly build?
Also, should the form-property type be "boolean" or "java.lang.Boolean"
(case-sensitive of course)?
Thanks.



> From: "Mathew, Manoj" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Thu, 4 Sep 2003 08:48:19 -0500
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: RE: Struts form validation of radio buttons and checkboxes
>
> YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN
> HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION
WE
> WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE
IT
> "FALSE"
>
> ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
> getCheckbox():return String  in your action form.
>
> -Original Message-
> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 7:48 AM
> To: Struts Users Mailing List
> Subject: Re: Struts form validation of radio buttons and checkboxes
>
>
> Thanks for the response, but I don't think the problem lies with the
actual
> validation that's happening.
> I suspect that when a user submits the form page without a checkbox/radio
> button checked, a blank variable is never sent to the form bean (i.e
> http://www.url.com/servlet.do?checkboxvar=), it just doesn't send
anything.
> The form bean then sees it as as a nonexistent variable and returns a
trace
> stack error. Any other ideas?
> I will however update my struts package.
>
>
>
>> From: Robert Leland <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Date: Wed, 03 Sep 2003 22:09:14 -0400
>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>> Subject: Re: Struts form validation of radio buttons and checkboxes
>>
>> Greg Amaroso wrote:
>>
>>> I'm having trouble with the struts form validation framework when it
comes
>>> to radio buttons and checkboxes. For some reason, I can validate any
other
>>> type of field, but not radios/checkboxes. Here's where I seem to be
having
>>> trouble:
>>>
>>>
>> Try a --nightly-- build of struts. I believe it has enhancements in
>> commons-validator to validate
>> radio controls. you can tell for sure by looking at the
validator-rules.xml.
>>
>> In there you'll see itels like :
>>   function validateRequired(form) {
>>
>> //Stuff deleted.
>>
>>   if (field.type == 'text' ||
>>   //stuff deleted
>>   field.type == 'radio' ||
>>   field.type == 'password') {
>>
>> So this says that for the 'required' rule radio is supported.
>>
>> Do the same for integer, byte, etc to see if 'radio' is supported.
>>
>>> In the struts-config.xml file, should the form-property type be set to
>>> java.lang.String or java.lang.Boolean?
>>>
>>> In the page with the form, does it look right to create the radio
buttons
>>> like this:
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> Are there any other tricks to doing this that differs from validating
>>> standard text boxes, textareas, etc.?
>>>
>>> Thank in advance.
>>>
>>>
>>> Greg Amaroso
>>>
>>>
>>>
>>
>>
>>
>> -
>> 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]


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



Re: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Greg Amaroso
I currently have Struts 1.1. Is the checkbox/radio update available in the
most current nightly build?
Also, should the form-property type be "boolean" or "java.lang.Boolean"
(case-sensitive of course)?
Thanks.



> From: "Mathew, Manoj" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Thu, 4 Sep 2003 08:48:19 -0500
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: RE: Struts form validation of radio buttons and checkboxes
> 
> YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN
> HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION WE
> WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE IT
> "FALSE"
> 
> ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
> getCheckbox():return String  in your action form.
> 
> -Original Message-
> From: Greg Amaroso [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2003 7:48 AM
> To: Struts Users Mailing List
> Subject: Re: Struts form validation of radio buttons and checkboxes
> 
> 
> Thanks for the response, but I don't think the problem lies with the actual
> validation that's happening.
> I suspect that when a user submits the form page without a checkbox/radio
> button checked, a blank variable is never sent to the form bean (i.e
> http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
> The form bean then sees it as as a nonexistent variable and returns a trace
> stack error. Any other ideas?
> I will however update my struts package.
> 
> 
> 
>> From: Robert Leland <[EMAIL PROTECTED]>
>> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Date: Wed, 03 Sep 2003 22:09:14 -0400
>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>> Subject: Re: Struts form validation of radio buttons and checkboxes
>> 
>> Greg Amaroso wrote:
>> 
>>> I'm having trouble with the struts form validation framework when it comes
>>> to radio buttons and checkboxes. For some reason, I can validate any other
>>> type of field, but not radios/checkboxes. Here's where I seem to be having
>>> trouble: 
>>>  
>>> 
>> Try a --nightly-- build of struts. I believe it has enhancements in
>> commons-validator to validate
>> radio controls. you can tell for sure by looking at the validator-rules.xml.
>> 
>> In there you'll see itels like :
>>   function validateRequired(form) {
>> 
>> //Stuff deleted.
>> 
>>   if (field.type == 'text' ||
>>   //stuff deleted
>>   field.type == 'radio' ||
>>   field.type == 'password') {
>> 
>> So this says that for the 'required' rule radio is supported.
>> 
>> Do the same for integer, byte, etc to see if 'radio' is supported.
>> 
>>> In the struts-config.xml file, should the form-property type be set to
>>> java.lang.String or java.lang.Boolean?
>>> 
>>> In the page with the form, does it look right to create the radio buttons
>>> like this:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Are there any other tricks to doing this that differs from validating
>>> standard text boxes, textareas, etc.?
>>> 
>>> Thank in advance.
>>> 
>>> 
>>> Greg Amaroso
>>> 
>>>  
>>> 
>> 
>> 
>> 
>> -
>> 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: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Andrew Hill
OI!
STOP ALL THAT SHOUTING!
ITS GIVING ME A HEADACHE.
(I know your terminal can do lower case - I can see it in your sample code!)

And while Ive got your attention, it is *not* "AN ERROR IN STRUTS" that the
checkbox is not submitted, it is a result of the html specifications (whose
writers probably came up with the idea after a few too many beers and
thought it would be a "bit of a laugh").

Browsers simply dont submit *anything* for an unticked checkbox and there
isnt anything that struts can do about it apart from provide a workaround in
the form of the reset() method. (Well actually I can think of one other
thing it could do but it involves JS and hidden fields and I rather doubt
the committers would approve.)

If you had bothered to read the javadoc for the reset() method of the
ActionForm class you would know this:

http://jakarta.apache.org/struts/api/index.html ">
Reset all bean properties to their default state. This method is called
before the properties are repopulated by the controller servlet. The default
implementation does nothing. Subclasses should override this method to reset
all bean properties to default values. This method is not the appropriate
place to initialize form values for an "update" type page (this should be
done in a setup Action). You mainly need to worry about setting checkbox
values to false; most of the time you can leave this method unimplemented


(Note the bit about checkboxes)


-Original Message-
From: Mathew, Manoj [mailto:[EMAIL PROTECTED]
Sent: Thursday, 4 September 2003 21:48
To: Struts Users Mailing List
Subject: RE: Struts form validation of radio buttons and checkboxes


YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN
HAVE THAT ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION WE
WROTE A CODE WHICH CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE IT
"FALSE"

ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if
getCheckbox():return String  in your action form.

-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 7:48 AM
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes


Thanks for the response, but I don't think the problem lies with the actual
validation that's happening.
I suspect that when a user submits the form page without a checkbox/radio
button checked, a blank variable is never sent to the form bean (i.e
http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
The form bean then sees it as as a nonexistent variable and returns a trace
stack error. Any other ideas?
I will however update my struts package.



> From: Robert Leland <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Wed, 03 Sep 2003 22:09:14 -0400
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Struts form validation of radio buttons and checkboxes
>
> Greg Amaroso wrote:
>
>> I'm having trouble with the struts form validation framework when it
comes
>> to radio buttons and checkboxes. For some reason, I can validate any
other
>> type of field, but not radios/checkboxes. Here's where I seem to be
having
>> trouble:
>>
>>
> Try a --nightly-- build of struts. I believe it has enhancements in
> commons-validator to validate
> radio controls. you can tell for sure by looking at the
validator-rules.xml.
>
> In there you'll see itels like :
>   function validateRequired(form) {
>
> //Stuff deleted.
>
>   if (field.type == 'text' ||
>   //stuff deleted
>   field.type == 'radio' ||
>   field.type == 'password') {
>
> So this says that for the 'required' rule radio is supported.
>
> Do the same for integer, byte, etc to see if 'radio' is supported.
>
>> In the struts-config.xml file, should the form-property type be set to
>> java.lang.String or java.lang.Boolean?
>>
>> In the page with the form, does it look right to create the radio buttons
>> like this:
>> 
>> 
>> 
>> 
>> 
>>
>> Are there any other tricks to doing this that differs from validating
>> standard text boxes, textareas, etc.?
>>
>> Thank in advance.
>>
>>
>> Greg Amaroso
>>
>>
>>
>
>
>
> -
> 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: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Mathew, Manoj
YES YOU R RIGHT. WHEN THE CHECK BOX IS NOT CHECKED, THE FORM WILL NOT EVEN HAVE THAT 
ELEMENT PRESENT. THIS IS AN ERROR IN STRUTS. IN OUR APPLICATION WE WROTE A CODE WHICH 
CHECK FOR THIS ELEMENT AN IT IS IS NOT THERE THEN MADE IT "FALSE"

ALSO MAKE SURE YOU HAVE isCheckbox():return boolean  instead if getCheckbox():return 
String  in your action form.

-Original Message-
From: Greg Amaroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 7:48 AM
To: Struts Users Mailing List
Subject: Re: Struts form validation of radio buttons and checkboxes


Thanks for the response, but I don't think the problem lies with the actual
validation that's happening.
I suspect that when a user submits the form page without a checkbox/radio
button checked, a blank variable is never sent to the form bean (i.e
http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
The form bean then sees it as as a nonexistent variable and returns a trace
stack error. Any other ideas?
I will however update my struts package.



> From: Robert Leland <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Wed, 03 Sep 2003 22:09:14 -0400
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Struts form validation of radio buttons and checkboxes
> 
> Greg Amaroso wrote:
> 
>> I'm having trouble with the struts form validation framework when it comes
>> to radio buttons and checkboxes. For some reason, I can validate any other
>> type of field, but not radios/checkboxes. Here's where I seem to be having
>> trouble: 
>>  
>> 
> Try a --nightly-- build of struts. I believe it has enhancements in
> commons-validator to validate
> radio controls. you can tell for sure by looking at the validator-rules.xml.
> 
> In there you'll see itels like :
>   function validateRequired(form) {
> 
> //Stuff deleted.
>  
>   if (field.type == 'text' ||
>   //stuff deleted
>   field.type == 'radio' ||
>   field.type == 'password') {
> 
> So this says that for the 'required' rule radio is supported.
> 
> Do the same for integer, byte, etc to see if 'radio' is supported.
> 
>> In the struts-config.xml file, should the form-property type be set to
>> java.lang.String or java.lang.Boolean?
>> 
>> In the page with the form, does it look right to create the radio buttons
>> like this:
>> 
>> 
>> 
>> 
>> 
>> 
>> Are there any other tricks to doing this that differs from validating
>> standard text boxes, textareas, etc.?
>> 
>> Thank in advance.
>> 
>> 
>> Greg Amaroso
>> 
>>  
>> 
> 
> 
> 
> -
> 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: Struts form validation of radio buttons and checkboxes

2003-09-04 Thread Greg Amaroso
Thanks for the response, but I don't think the problem lies with the actual
validation that's happening.
I suspect that when a user submits the form page without a checkbox/radio
button checked, a blank variable is never sent to the form bean (i.e
http://www.url.com/servlet.do?checkboxvar=), it just doesn't send anything.
The form bean then sees it as as a nonexistent variable and returns a trace
stack error. Any other ideas?
I will however update my struts package.



> From: Robert Leland <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Date: Wed, 03 Sep 2003 22:09:14 -0400
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Struts form validation of radio buttons and checkboxes
> 
> Greg Amaroso wrote:
> 
>> I'm having trouble with the struts form validation framework when it comes
>> to radio buttons and checkboxes. For some reason, I can validate any other
>> type of field, but not radios/checkboxes. Here's where I seem to be having
>> trouble: 
>>  
>> 
> Try a --nightly-- build of struts. I believe it has enhancements in
> commons-validator to validate
> radio controls. you can tell for sure by looking at the validator-rules.xml.
> 
> In there you'll see itels like :
>   function validateRequired(form) {
> 
> //Stuff deleted.
>  
>   if (field.type == 'text' ||
>   //stuff deleted
>   field.type == 'radio' ||
>   field.type == 'password') {
> 
> So this says that for the 'required' rule radio is supported.
> 
> Do the same for integer, byte, etc to see if 'radio' is supported.
> 
>> In the struts-config.xml file, should the form-property type be set to
>> java.lang.String or java.lang.Boolean?
>> 
>> In the page with the form, does it look right to create the radio buttons
>> like this:
>> 
>> 
>> 
>> 
>> 
>> 
>> Are there any other tricks to doing this that differs from validating
>> standard text boxes, textareas, etc.?
>> 
>> Thank in advance.
>> 
>> 
>> Greg Amaroso
>> 
>>  
>> 
> 
> 
> 
> -
> 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: Struts form validation of radio buttons and checkboxes

2003-09-03 Thread Robert Leland
Greg Amaroso wrote:

I'm having trouble with the struts form validation framework when it comes
to radio buttons and checkboxes. For some reason, I can validate any other
type of field, but not radios/checkboxes. Here's where I seem to be having
trouble: 
 

Try a --nightly-- build of struts. I believe it has enhancements in 
commons-validator to validate
radio controls. you can tell for sure by looking at the validator-rules.xml.

In there you'll see itels like :
   function validateRequired(form) {
 
//Stuff deleted.
  
   if (field.type == 'text' ||
   //stuff deleted
   field.type == 'radio' ||
   field.type == 'password') {

So this says that for the 'required' rule radio is supported.

Do the same for integer, byte, etc to see if 'radio' is supported.

In the struts-config.xml file, should the form-property type be set to
java.lang.String or java.lang.Boolean?
In the page with the form, does it look right to create the radio buttons
like this:





Are there any other tricks to doing this that differs from validating
standard text boxes, textareas, etc.?
Thank in advance. 

Greg Amaroso

 



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


Struts form validation of radio buttons and checkboxes

2003-09-03 Thread Greg Amaroso
I'm having trouble with the struts form validation framework when it comes
to radio buttons and checkboxes. For some reason, I can validate any other
type of field, but not radios/checkboxes. Here's where I seem to be having
trouble: 

In the struts-config.xml file, should the form-property type be set to
java.lang.String or java.lang.Boolean?

In the page with the form, does it look right to create the radio buttons
like this:






Are there any other tricks to doing this that differs from validating
standard text boxes, textareas, etc.?

Thank in advance. 


Greg Amaroso


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



RE: Struts form validation: DAO and multipages

2003-09-01 Thread Seyhan BASMACI (Internet Yazilimlari Yetkilisi)

for the input parameter of Action form Mapping enter something like this 
"myaction.do?validateControl=0"

add "validateControl" attribute to your actionForm
if struts redirects (redirect if validations fails) the page to the to resource 
specified in input parameter of action form mapping validateControl parameter will be 
0 , 
othewise it will be null ,
if it is 0 you must bypass your validation logic and set the page to the previous 
page..

validate(){

if "page1".equals(page){
  if (validateControl == 0) {
// dont chage page just return , this is the first page
return; 
  } 

// normal flow of validation for page 1

}

if "page2".equals(page){
  if (validateControl == 0) {
// set page property to previous page 
page= "page1";
return; 
  } 

// normal flow of validation for page 2 

}

if "page3".equals(page){
  if (validateControl == 0) {
// set page property to previous page 
page= "page2";
return;
  } 

// normal flow of validation page 3 

}

} 



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, September 01, 2003 4:10 PM
To: Struts Users Mailing List
Subject: Re: Struts form validation: DAO and multipages


I would use seperate mappings. That is what I have always done. However 
you shouldn't consider this as carte blanche to chain loads of actions 
together - that is considered a sign of MVC framework violation.

Adam

On 09/01/2003 01:49 PM Leyla TOLUN (Internet Yazilimlari Yonetmeni) wrote:
> Hi Adam,
> 
> Well, I tried to use a mapping as an input value but this has a catch. 
> 
> As a matter of fact, I use the same Action and Action Form class for each page in a 
> workflow. I have a Page field on my Actionform class. The value assigned to it 
> simply helps me to select the next ActionForward. 
> 
> Now, when I set the same ActionMapping as the input directive, I need a way to set 
> my page field so that, I will be redirected just to my previous action. Do you have 
> any recommendations? 
> 
> Otherwise, I will have to define a seperate mapping for each workflow page , which I 
> hope will solve the problem. 
> 
> 
> -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 01, 2003 12:41 PM
> To: Struts Users Mailing List
> Subject: Re: Struts form validation: DAO and multipages
> 
> 
> Hi Leyla, working out a strategy for your lists can be as simple or as 
> complicated as you want it to be. In my mappings I point my 'input' back 
> to the appropriate mapping that will execute an action where I sort out 
> the lists I need.
> 
> Adam
> On 09/01/2003 11:18 AM Leyla TOLUN (Internet Yazilimlari Yonetmeni) wrote:
> 
>>Nobody has an idea on the subject? 
>>
>>This should be a problem for anyone that codes, select one  and continue type web 
>>apps. 
>>
>>
>>-Original Message-
>>From: Leyla TOLUN (Internet Yazilimlari Yonetmeni) 
>>Sent: Friday, August 29, 2003 10:58 AM
>>To: Struts Users Mailing List
>>Subject: Struts form validation: DAO and multipages
>>
>>
>>Hi,
>>
>>I have a multipage transaction. On the first page, inside the Action class , I bind 
>>a DAO list to request. This is listed on the second page. When I submit the formed 
>>page, if the next ActionForm.validate fails, it automatically returns to the previos 
>>page. (As defined in the sturts_config.xml form_bean/input directive.) 
>>Since my DAO list does not exist in the newly formed request I see nothing. 
>>
>>Is there a way to reexecute my previous ActionMapping when a fom validation fails. 
>>(for a multipage app.)  Or can anyone reccomend a way to handle multipage apps. 
>>(Storing DAO in the session seem inefficient, since there may be lots of such cases.)
>>
>>Regards,
>>
>>Leyla
>>
>>-
>>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]
>>
>>
> 
> 

-- 
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9


-
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: Struts form validation: DAO and multipages

2003-09-01 Thread Adam Hardy
I would use seperate mappings. That is what I have always done. However 
you shouldn't consider this as carte blanche to chain loads of actions 
together - that is considered a sign of MVC framework violation.

Adam

On 09/01/2003 01:49 PM Leyla TOLUN (Internet Yazilimlari Yonetmeni) wrote:
Hi Adam,

Well, I tried to use a mapping as an input value but this has a catch. 

As a matter of fact, I use the same Action and Action Form class for each page in a workflow. I have a Page field on my Actionform class. The value assigned to it simply helps me to select the next ActionForward. 

Now, when I set the same ActionMapping as the input directive, I need a way to set my page field so that, I will be redirected just to my previous action. Do you have any recommendations? 

Otherwise, I will have to define a seperate mapping for each workflow page , which I hope will solve the problem. 

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, September 01, 2003 12:41 PM
To: Struts Users Mailing List
Subject: Re: Struts form validation: DAO and multipages
Hi Leyla, working out a strategy for your lists can be as simple or as 
complicated as you want it to be. In my mappings I point my 'input' back 
to the appropriate mapping that will execute an action where I sort out 
the lists I need.

Adam
On 09/01/2003 11:18 AM Leyla TOLUN (Internet Yazilimlari Yonetmeni) wrote:
Nobody has an idea on the subject? 

This should be a problem for anyone that codes, select one  and continue type web apps. 

-Original Message-
From: Leyla TOLUN (Internet Yazilimlari Yonetmeni) 
Sent: Friday, August 29, 2003 10:58 AM
To: Struts Users Mailing List
Subject: Struts form validation: DAO and multipages

Hi,

I have a multipage transaction. On the first page, inside the Action class , I bind a DAO list to request. This is listed on the second page. When I submit the formed page, if the next ActionForm.validate fails, it automatically returns to the previos page. (As defined in the sturts_config.xml form_bean/input directive.) 
Since my DAO list does not exist in the newly formed request I see nothing. 

Is there a way to reexecute my previous ActionMapping when a fom validation fails. (for a multipage app.)  Or can anyone reccomend a way to handle multipage apps. (Storing DAO in the session seem inefficient, since there may be lots of such cases.)

Regards,

Leyla

-
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]



--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Struts form validation: DAO and multipages

2003-09-01 Thread Leyla TOLUN (Internet Yazilimlari Yonetmeni)

Hi Adam,

Well, I tried to use a mapping as an input value but this has a catch. 

As a matter of fact, I use the same Action and Action Form class for each page in a 
workflow. I have a Page field on my Actionform class. The value assigned to it simply 
helps me to select the next ActionForward. 

Now, when I set the same ActionMapping as the input directive, I need a way to set my 
page field so that, I will be redirected just to my previous action. Do you have any 
recommendations? 

Otherwise, I will have to define a seperate mapping for each workflow page , which I 
hope will solve the problem. 


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, September 01, 2003 12:41 PM
To: Struts Users Mailing List
Subject: Re: Struts form validation: DAO and multipages


Hi Leyla, working out a strategy for your lists can be as simple or as 
complicated as you want it to be. In my mappings I point my 'input' back 
to the appropriate mapping that will execute an action where I sort out 
the lists I need.

Adam
On 09/01/2003 11:18 AM Leyla TOLUN (Internet Yazilimlari Yonetmeni) wrote:
> Nobody has an idea on the subject? 
> 
> This should be a problem for anyone that codes, select one  and continue type web 
> apps. 
> 
> 
> -Original Message-
> From: Leyla TOLUN (Internet Yazilimlari Yonetmeni) 
> Sent: Friday, August 29, 2003 10:58 AM
> To: Struts Users Mailing List
> Subject: Struts form validation: DAO and multipages
> 
> 
> Hi,
> 
> I have a multipage transaction. On the first page, inside the Action class , I bind 
> a DAO list to request. This is listed on the second page. When I submit the formed 
> page, if the next ActionForm.validate fails, it automatically returns to the previos 
> page. (As defined in the sturts_config.xml form_bean/input directive.) 
> Since my DAO list does not exist in the newly formed request I see nothing. 
> 
> Is there a way to reexecute my previous ActionMapping when a fom validation fails. 
> (for a multipage app.)  Or can anyone reccomend a way to handle multipage apps. 
> (Storing DAO in the session seem inefficient, since there may be lots of such cases.)
> 
> Regards,
> 
> Leyla
> 
> -
> 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]
> 
> 

-- 
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9


-
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: Struts form validation: DAO and multipages

2003-09-01 Thread Firat TIRYAKI
Well, try a javascript solution ;

1) history.go(-1);

or

2) document.location.replace("your url here");

or

3) recreate your DAO list in the validate and you can use it in the page.

or

send the first action to us, have to know what it does, if the problem
continues. :o)

F.

- Original Message - 
From: "Leyla TOLUN (Internet Yazilimlari Yonetmeni)" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, September 01, 2003 12:18 PM
Subject: Struts form validation: DAO and multipages



Nobody has an idea on the subject?

This should be a problem for anyone that codes, select one  and continue
type web apps.


-Original Message-
From: Leyla TOLUN (Internet Yazilimlari Yonetmeni)
Sent: Friday, August 29, 2003 10:58 AM
To: Struts Users Mailing List
Subject: Struts form validation: DAO and multipages


Hi,

I have a multipage transaction. On the first page, inside the Action class ,
I bind a DAO list to request. This is listed on the second page. When I
submit the formed page, if the next ActionForm.validate fails, it
automatically returns to the previos page. (As defined in the
sturts_config.xml form_bean/input directive.)
Since my DAO list does not exist in the newly formed request I see nothing.

Is there a way to reexecute my previous ActionMapping when a fom validation
fails. (for a multipage app.)  Or can anyone reccomend a way to handle
multipage apps. (Storing DAO in the session seem inefficient, since there
may be lots of such cases.)

Regards,

Leyla

-
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: Struts form validation: DAO and multipages

2003-09-01 Thread Adam Hardy
Hi Leyla, working out a strategy for your lists can be as simple or as 
complicated as you want it to be. In my mappings I point my 'input' back 
to the appropriate mapping that will execute an action where I sort out 
the lists I need.

Adam
On 09/01/2003 11:18 AM Leyla TOLUN (Internet Yazilimlari Yonetmeni) wrote:
Nobody has an idea on the subject? 

This should be a problem for anyone that codes, select one  and continue type web apps. 

-Original Message-
From: Leyla TOLUN (Internet Yazilimlari Yonetmeni) 
Sent: Friday, August 29, 2003 10:58 AM
To: Struts Users Mailing List
Subject: Struts form validation: DAO and multipages

Hi,

I have a multipage transaction. On the first page, inside the Action class , I bind a DAO list to request. This is listed on the second page. When I submit the formed page, if the next ActionForm.validate fails, it automatically returns to the previos page. (As defined in the sturts_config.xml form_bean/input directive.) 
Since my DAO list does not exist in the newly formed request I see nothing. 

Is there a way to reexecute my previous ActionMapping when a fom validation fails. (for a multipage app.)  Or can anyone reccomend a way to handle multipage apps. (Storing DAO in the session seem inefficient, since there may be lots of such cases.)

Regards,

Leyla

-
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]

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Struts form validation: DAO and multipages

2003-09-01 Thread Leyla TOLUN (Internet Yazilimlari Yonetmeni)

Nobody has an idea on the subject? 

This should be a problem for anyone that codes, select one  and continue type web 
apps. 


-Original Message-
From: Leyla TOLUN (Internet Yazilimlari Yonetmeni) 
Sent: Friday, August 29, 2003 10:58 AM
To: Struts Users Mailing List
Subject: Struts form validation: DAO and multipages


Hi,

I have a multipage transaction. On the first page, inside the Action class , I bind a 
DAO list to request. This is listed on the second page. When I submit the formed page, 
if the next ActionForm.validate fails, it automatically returns to the previos page. 
(As defined in the sturts_config.xml form_bean/input directive.) 
Since my DAO list does not exist in the newly formed request I see nothing. 

Is there a way to reexecute my previous ActionMapping when a fom validation fails. 
(for a multipage app.)  Or can anyone reccomend a way to handle multipage apps. 
(Storing DAO in the session seem inefficient, since there may be lots of such cases.)

Regards,

Leyla

-
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]



Struts form validation: DAO and multipages

2003-08-29 Thread Leyla TOLUN (Internet Yazilimlari Yonetmeni)
Hi,

I have a multipage transaction. On the first page, inside the Action class , I bind a 
DAO list to request. This is listed on the second page. When I submit the formed page, 
if the next ActionForm.validate fails, it automatically returns to the previos page. 
(As defined in the sturts_config.xml form_bean/input directive.) 
Since my DAO list does not exist in the newly formed request I see nothing. 

Is there a way to reexecute my previous ActionMapping when a fom validation fails. 
(for a multipage app.)  Or can anyone reccomend a way to handle multipage apps. 
(Storing DAO in the session seem inefficient, since there may be lots of such cases.)

Regards,

Leyla

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



RE: Bypassing Form Validation

2003-08-22 Thread Syed, Nazeer

There are 2 ways to solve this problem
1. through Javascript
2. in FormBean

1. Write the even on the Onsubmit of the form 

on this javascript method return false when cancel is clicked.

2. On Validate method of the form bean you can check the Cancel button
clicked if yes then return or do validation.



Thanks
Nazeer




-Original Message-
From: David Stemm [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 12:39 PM
To: Struts Users Mailing List
Subject: Bypassing Form Validation

I'm having trouble trying to cancel out of a form.  I have a cancel
button that looks like this:



and while the onclick event does cancel out the javascript validation it
still goes ahead and performs the server-side validation and I get
errors saying certain fields are required, etc.  I'm using a
DynaValidatorForm and my action class inherits from DispatchAction.
Anybody have any ideas?


David Stemm

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



Re: Bypassing Form Validation

2003-08-22 Thread Sloan Seaman
If you want to validation to be turned off in both javascript and server
side you ahve to use the   tag

You will not be able to set the property for this tag because if you do,
struts won't know where to look to find the submittal to see if it should or
shouldn't do the server side validation.

Your onClick could will work fine for the javascript validation but you will
not need it if you use  because it will put that code in there
for you.

--
Sloan


- Original Message - 
From: "David Stemm" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 12:38 PM
Subject: Bypassing Form Validation


I'm having trouble trying to cancel out of a form.  I have a cancel button
that looks like this:



and while the onclick event does cancel out the javascript validation it
still goes ahead and performs the server-side validation and I get errors
saying certain fields are required, etc.  I'm using a DynaValidatorForm and
my action class inherits from DispatchAction.  Anybody have any ideas?


David Stemm



This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com


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



Re: Bypassing Form Validation

2003-08-22 Thread David Stemm
Tried that - it still performs the server-side validation.

- Original Message - 
From: "Norm Deane" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 12:07 PM
Subject: RE: Bypassing Form Validation


> Try
> 
> 
> 
> 
> -- 
> Norm Deane
> MIS Consultant
> Vanderbilt University
> (615) 322-7855
> [EMAIL PROTECTED] 
> 
> -Original Message-
> From: David Stemm [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 22, 2003 10:39 AM
> To: Struts Users Mailing List
> Subject: Bypassing Form Validation
> 
> 
> I'm having trouble trying to cancel out of a form.  I have a cancel
> button that looks like this:
> 
>  tabindex='24' onclick="bCancel=true;"/>
> 
> and while the onclick event does cancel out the javascript validation it
> still goes ahead and performs the server-side validation and I get
> errors saying certain fields are required, etc.  I'm using a
> DynaValidatorForm and my action class inherits from DispatchAction.
> Anybody have any ideas?
> 
> 
> David Stemm
> 
> 
> -
> 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: Bypassing Form Validation

2003-08-22 Thread Norm Deane
Try




-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
[EMAIL PROTECTED] 

-Original Message-
From: David Stemm [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 10:39 AM
To: Struts Users Mailing List
Subject: Bypassing Form Validation


I'm having trouble trying to cancel out of a form.  I have a cancel
button that looks like this:



and while the onclick event does cancel out the javascript validation it
still goes ahead and performs the server-side validation and I get
errors saying certain fields are required, etc.  I'm using a
DynaValidatorForm and my action class inherits from DispatchAction.
Anybody have any ideas?


David Stemm


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



Bypassing Form Validation

2003-08-22 Thread David Stemm
I'm having trouble trying to cancel out of a form.  I have a cancel button that looks 
like this:



and while the onclick event does cancel out the javascript validation it still goes 
ahead and performs the server-side validation and I get errors saying certain fields 
are required, etc.  I'm using a DynaValidatorForm and my action class inherits from 
DispatchAction.  Anybody have any ideas?


David Stemm

RE: DispatchActions - using form validation for only some methods

2003-07-30 Thread Paul McCulloch
I don't think I can utilise the first approach as I am always using the same
action (via the html form's submit).

The second approach may do the trick - though I'll have to start using the
validator (rather than the default stuff in the action form).

Thanks for your help,

Paul

-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED]
Sent: 30 July 2003 15:00
To: 'Struts Users Mailing List'
Subject: RE: DispatchActions - using form validation for only some
methods



Not sure if anybody answered you question or not yet but there are a couple
things you can do...

1. Have many action mappings to one DispatchAction.  
 ... 
 ... 

link to each as "/a.do?subtask=method1" and "/b.do?subtask=method2" and then
do validation per action and not per form.

The other alternative suggested by Robert Taylor, which, once set up, is
pretty slick but involves a little extension to how validator works:
http://marc.theaimsgroup.com/?t=10535260067&r=1&w=2





-Original Message-
From: Paul McCulloch [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 7:59 AM
To: 'Struts Users Mailing List'
Subject: DispatchActions - using form validation for only some methods

Hi,

I've just moved to using dispatch actions from my own implementation of
something similair to relay actions. One facility my implementation gave me
was to have the form validated when some actions were called, and not
validated for other actions (at the expense of a bloated struts-config.xml).

Using dispatch actions I am now explicitly calling the form's validation for
those methods that require a validated form:

ActionErrors errors = form.validate(mapping, request);
 if(!errors.isEmpty()) {
 saveErrors(request, errors);
 return new ActionForward(mapping.getInput());
}

Is there a better way of achieving this?

thanks,

Paul


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not copy or deliver this message to
anyone. In such case, you should destroy this message, and notify us
immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code.  You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.


-
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: DispatchActions - using form validation for only some methods

2003-07-30 Thread Bailey, Shane C.

Not sure if anybody answered you question or not yet but there are a couple
things you can do...

1. Have many action mappings to one DispatchAction.  
 ... 
 ... 

link to each as "/a.do?subtask=method1" and "/b.do?subtask=method2" and then
do validation per action and not per form.

The other alternative suggested by Robert Taylor, which, once set up, is
pretty slick but involves a little extension to how validator works:
http://marc.theaimsgroup.com/?t=10535260067&r=1&w=2





-Original Message-
From: Paul McCulloch [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 7:59 AM
To: 'Struts Users Mailing List'
Subject: DispatchActions - using form validation for only some methods

Hi,

I've just moved to using dispatch actions from my own implementation of
something similair to relay actions. One facility my implementation gave me
was to have the form validated when some actions were called, and not
validated for other actions (at the expense of a bloated struts-config.xml).

Using dispatch actions I am now explicitly calling the form's validation for
those methods that require a validated form:

ActionErrors errors = form.validate(mapping, request);
 if(!errors.isEmpty()) {
 saveErrors(request, errors);
 return new ActionForward(mapping.getInput());
}

Is there a better way of achieving this?

thanks,

Paul


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not copy or deliver this message to
anyone. In such case, you should destroy this message, and notify us
immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code.  You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.


-
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]



DispatchActions - using form validation for only some methods

2003-07-30 Thread Paul McCulloch
Hi,

I've just moved to using dispatch actions from my own implementation of
something similair to relay actions. One facility my implementation gave me
was to have the form validated when some actions were called, and not
validated for other actions (at the expense of a bloated struts-config.xml).

Using dispatch actions I am now explicitly calling the form's validation for
those methods that require a validated form:

ActionErrors errors = form.validate(mapping, request);
 if(!errors.isEmpty()) {
 saveErrors(request, errors);
 return new ActionForward(mapping.getInput());
}

Is there a better way of achieving this?

thanks,

Paul


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


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



Re: Partial form validation...

2003-07-25 Thread manglu
Keith,

I am not too sure what "Partial Form Validation" is

I am playing with multi-page Validation at the moment so i can share 
some of the stuff that i understand so far.

(i) Turn off the validation in the Struts-Config and invoke the 
Validation via the validate method in action Object (Not sure if this is 
a must. I just followed the Validation Sample)

(ii) My validation.xml(s)  are simple and i don't do inter-field 
validation in the xml file i choose to do them in the Validate method 
itself. I feel it is easier to do it here.(a bit better to read than in 
the Validation.xml with the requiredif etc)

HTH
Manglu






Keith Pemberton wrote:
I have read that when you do a multipage form that you have to do
partial form validation.  Otherwise, the page just gets thrown back as
not being valid.  Can someone please give me a sample of how this works
in the ActionForm bean?  Thanks!
Keith


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


Partial form validation...

2003-07-24 Thread Keith Pemberton
I have read that when you do a multipage form that you have to do
partial form validation.  Otherwise, the page just gets thrown back as
not being valid.  Can someone please give me a sample of how this works
in the ActionForm bean?  Thanks!

Keith
-- 
Keith Pemberton <[EMAIL PROTECTED]>


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



Formatting form validation errors differently within the same application

2003-07-10 Thread Dhruva B. Reddy
I have built an application with Struts 1.0, which has a couple of
forms that require validation.  Each of these forms requires different
formatting for the error messages.

I was going to do this by creating another resource file (in other
words, have one resource file for each form that requires validation). 
Is this the way this is commonly accomplished?  How do I reference the
additional files in the application deployment descriptor?

Thanks,
Dhruva

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: Form validation over multiple pages - Solution Found - Weird

2003-05-31 Thread Brian McSweeney
Could anyone tell me if I am right in what I think the problem is here?

I use a web-filter for ssl. I use form-beans that have session scope
in a wizard, one of whose steps requires ssl.

However when the ssl step gets intercepted by the web filter,
the form-bean that should be in session scope seems to be
cleared/re-created.

Any ideas as to why?

Brian

- Original Message -
From: "Brian McSweeney" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, May 30, 2003 11:04 AM
Subject: Re: Form validation over multiple pages - Solution Found - Weird


> Thanks for the help on this guys. It was good to know people had
> it working.
>
> I've got it to work now. The reason it wasn't working was that for
> all secure pages I use a ssl filter which takes any request mapped like
> "/secure" and sends it over ssl.
>
> For example, if I want to send the
> info for the first jsp I send it to:
>
> 
> the weird thing is - the form object isn't staying in session scope if I
use
> the ssl filter and so the second page's validation was failing because the
> object wasn't in session scope anymore. However, once I removed the
> "secure" it works fine.
>
> Reading other threads, I think this might be to do with a redirect ( if
the
> filter is doing a re-direct, then a new http request might be getting
> created
> and thus a new form object gets created )
>
> Anyway, thanks for all the help, and if anyone knows how I could continue
> using the filter and keep the form object in session scope I'd really
> appreciate
> any ideas!
>
> Brian
>
>
> - Original Message -
> From: "Paul Curren" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, May 29, 2003 6:00 PM
> Subject: Re: Form validation over multiple pages
>
>
> > Hi there,
> > I've been doing this exact thing the last couple of days and I have it
> > working.
> > My html:hidden tags looks like -
> >
> > 
> > i.e. only difference is I don't explicitly specify the form name.
> >
> > My form is a DynaValidatorForm and a bug which i've seen from rc1 right
> > up to the May 26 nightly so far means that I need to explicity define
> > the page property on the form e.g.
> >
> > 
> >
> > Hope this helps,
> >
> > Paul C
> >
> >
> > Brian McSweeney wrote:
> >
> > >With a little further investigation I see that the page value does not
> > >get set in the validationForm using html:hidden approach as outlined
> > >below. Ie, this doen't work:
> > >
> > >
> > >
> > >When I print out the value of the page field in the action, it is still
> set
> > >to zero.
> > >
> > >How do you set the page property?
> > >
> > >Also, this seems to imply the validator is VERY shaky over multiple
> > >pages. For example, the properties on my second page are marked
> > >as required, and they don't get validated in the first action (this
seems
> > >to show that the page based validation is working), yet on the second
> > >page, the associated action tries to validate the page 1 properties!!!
> > >
> > >Arrrg!! What's going on! Has anyone got this to work?
> > >
> > >Brian
> > >
> > >
> > >- Original Message -
> > >From: "Brian McSweeney" <[EMAIL PROTECTED]>
> > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > >Sent: Thursday, May 29, 2003 2:42 PM
> > >Subject: Form validation over multiple pages
> > >
> > >
> > >Hi all,
> > >
> > >I'm almost there with using the validator over several pages with a
> single
> > >form.
> > >However I'm getting a strange little error. The first page is
validating
> > >fine, and it
> > >doesn't seem to try to validate the info required on the second page -
> > >correct.
> > >However once I try to validate the second page, the javascript
validates
> > >correctly,
> > >but the server side validation returns an error saying the first page's
> > >required field
> > >needs validating.
> > >
> > >I think it might be because I'm not sure how to pass the page parameter
> to
> > >the action.
> > >I've tried using a html:hidden tag. Anyway, snippets from the jsps,
> struts
> > >config and
> > >validation.xml f

Re: Form validation over multiple pages - Solution Found - Weird

2003-05-30 Thread Brian McSweeney
Thanks for the help on this guys. It was good to know people had
it working.

I've got it to work now. The reason it wasn't working was that for
all secure pages I use a ssl filter which takes any request mapped like
"/secure" and sends it over ssl.

For example, if I want to send the
info for the first jsp I send it to:


To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 6:00 PM
Subject: Re: Form validation over multiple pages


> Hi there,
> I've been doing this exact thing the last couple of days and I have it
> working.
> My html:hidden tags looks like -
>
> 
> i.e. only difference is I don't explicitly specify the form name.
>
> My form is a DynaValidatorForm and a bug which i've seen from rc1 right
> up to the May 26 nightly so far means that I need to explicity define
> the page property on the form e.g.
>
> 
>
> Hope this helps,
>
> Paul C
>
>
> Brian McSweeney wrote:
>
> >With a little further investigation I see that the page value does not
> >get set in the validationForm using html:hidden approach as outlined
> >below. Ie, this doen't work:
> >
> >
> >
> >When I print out the value of the page field in the action, it is still
set
> >to zero.
> >
> >How do you set the page property?
> >
> >Also, this seems to imply the validator is VERY shaky over multiple
> >pages. For example, the properties on my second page are marked
> >as required, and they don't get validated in the first action (this seems
> >to show that the page based validation is working), yet on the second
> >page, the associated action tries to validate the page 1 properties!!!
> >
> >Arrrg!! What's going on! Has anyone got this to work?
> >
> >Brian
> >
> >
> >- Original Message -
> >From: "Brian McSweeney" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Sent: Thursday, May 29, 2003 2:42 PM
> >Subject: Form validation over multiple pages
> >
> >
> >Hi all,
> >
> >I'm almost there with using the validator over several pages with a
single
> >form.
> >However I'm getting a strange little error. The first page is validating
> >fine, and it
> >doesn't seem to try to validate the info required on the second page -
> >correct.
> >However once I try to validate the second page, the javascript validates
> >correctly,
> >but the server side validation returns an error saying the first page's
> >required field
> >needs validating.
> >
> >I think it might be because I'm not sure how to pass the page parameter
to
> >the action.
> >I've tried using a html:hidden tag. Anyway, snippets from the jsps,
struts
> >config and
> >validation.xml file are included below.
> >
> >If someone could help me out I'd be very grateful. Thanks very much,
> >Brian.
> >
> >
> >
> >
> >My first jsp named "validatestep1.jsp" looks like:
> >
> >
> >
> >
> >
> >
> > username
> >  
> > 
> > 
> >  
> >   
> >  
> >  
> >
> >
> >
> >My second jsp named "validatestep2.jsp" looks like
> >
> >
> >
> >
> >
> > 
> >  credit card with no spaces or dashes
> >  
> > 
> > 
> >  
> >   
> >  
> >  
> >
> >
> >
> >
> >in my struts config I have
> >
> > >  path="/secure/validateStep1"
> >  type="ValidateStep1Action"
> >  name="validateForm"
> >  scope="session"
> >  input="/validatestep1.jsp"
> >  unknown="false"
> >  validate="true"
> >>
> >   >name="success"
> >path="/validatestep2.jsp"
> >redirect="false"
> >  />
> >
> >and then
> >
> > >  path="/secure/validateStep2"
> >  type="ValidateStep2Action"
> >  name="validateForm"
> >  scope="session"
> >  input="/validatestep2.jsp"
> >  unknown="false"
> >  validate="true"
> >>
> >   >name="success"
> >path="/validated.jsp"
> >redirect="false"
> >  />
> >
> >In my validation.xml file I have
> >
> >
> >  
> >   >page="1">
> >
> >   >page="2">
> >
> >
> >
> >-
> >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 over multiple pages

2003-05-30 Thread Paul Curren
Hi there,
I've been doing this exact thing the last couple of days and I have it 
working.
My html:hidden tags looks like -


i.e. only difference is I don't explicitly specify the form name.
My form is a DynaValidatorForm and a bug which i've seen from rc1 right 
up to the May 26 nightly so far means that I need to explicity define 
the page property on the form e.g.



Hope this helps,

Paul C

Brian McSweeney wrote:

With a little further investigation I see that the page value does not
get set in the validationForm using html:hidden approach as outlined
below. Ie, this doen't work:
   

When I print out the value of the page field in the action, it is still set
to zero.
How do you set the page property?

Also, this seems to imply the validator is VERY shaky over multiple
pages. For example, the properties on my second page are marked
as required, and they don't get validated in the first action (this seems
to show that the page based validation is working), yet on the second
page, the associated action tries to validate the page 1 properties!!!
Arrrg!! What's going on! Has anyone got this to work?

Brian

- Original Message -
From: "Brian McSweeney" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 2:42 PM
Subject: Form validation over multiple pages
Hi all,

I'm almost there with using the validator over several pages with a single
form.
However I'm getting a strange little error. The first page is validating
fine, and it
doesn't seem to try to validate the info required on the second page -
correct.
However once I try to validate the second page, the javascript validates
correctly,
but the server side validation returns an error saying the first page's
required field
needs validating.
I think it might be because I'm not sure how to pass the page parameter to
the action.
I've tried using a html:hidden tag. Anyway, snippets from the jsps, struts
config and
validation.xml file are included below.
If someone could help me out I'd be very grateful. Thanks very much,
Brian.


My first jsp named "validatestep1.jsp" looks like:




   

username
 


 
  
 
 


My second jsp named "validatestep2.jsp" looks like



   


 credit card with no spaces or dashes
 


 
  
 
 


in my struts config I have

   
 
and then

   
 
In my validation.xml file I have

 
 
 


-
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 over multiple pages

2003-05-30 Thread David Graham

With a little further investigation I see that the page value does not
get set in the validationForm using html:hidden approach as outlined
below. Ie, this doen't work:


When I print out the value of the page field in the action, it is still set
to zero.
How do you set the page property?

Also, this seems to imply the validator is VERY shaky over multiple
pages. For example, the properties on my second page are marked
as required, and they don't get validated in the first action (this seems
to show that the page based validation is working), yet on the second
page, the associated action tries to validate the page 1 properties!!!
I believe the server side validation validates any page <= the current page 
and the client side javascript just validates the current page.

David

Arrrg!! What's going on! Has anyone got this to work?

Brian

- Original Message -
From: "Brian McSweeney" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 2:42 PM
Subject: Form validation over multiple pages
Hi all,

I'm almost there with using the validator over several pages with a single
form.
However I'm getting a strange little error. The first page is validating
fine, and it
doesn't seem to try to validate the info required on the second page -
correct.
However once I try to validate the second page, the javascript validates
correctly,
but the server side validation returns an error saying the first page's
required field
needs validating.
I think it might be because I'm not sure how to pass the page parameter to
the action.
I've tried using a html:hidden tag. Anyway, snippets from the jsps, struts
config and
validation.xml file are included below.
If someone could help me out I'd be very grateful. Thanks very much,
Brian.


My first jsp named "validatestep1.jsp" looks like:






 username
  
 
 
  
   
  
  


My second jsp named "validatestep2.jsp" looks like





 
  credit card with no spaces or dashes
  
 
 
  
   
  
  


in my struts config I have


  
and then


  
In my validation.xml file I have

  
  
  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Re: Form validation over multiple pages

2003-05-30 Thread Brian McSweeney
With a little further investigation I see that the page value does not
get set in the validationForm using html:hidden approach as outlined
below. Ie, this doen't work:



When I print out the value of the page field in the action, it is still set
to zero.

How do you set the page property?

Also, this seems to imply the validator is VERY shaky over multiple
pages. For example, the properties on my second page are marked
as required, and they don't get validated in the first action (this seems
to show that the page based validation is working), yet on the second
page, the associated action tries to validate the page 1 properties!!!

Arrrg!! What's going on! Has anyone got this to work?

Brian


- Original Message -
From: "Brian McSweeney" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 2:42 PM
Subject: Form validation over multiple pages


Hi all,

I'm almost there with using the validator over several pages with a single
form.
However I'm getting a strange little error. The first page is validating
fine, and it
doesn't seem to try to validate the info required on the second page -
correct.
However once I try to validate the second page, the javascript validates
correctly,
but the server side validation returns an error saying the first page's
required field
needs validating.

I think it might be because I'm not sure how to pass the page parameter to
the action.
I've tried using a html:hidden tag. Anyway, snippets from the jsps, struts
config and
validation.xml file are included below.

If someone could help me out I'd be very grateful. Thanks very much,
Brian.




My first jsp named "validatestep1.jsp" looks like:






 username
  
 
 
  
   
  
  



My second jsp named "validatestep2.jsp" looks like





 
  credit card with no spaces or dashes
  
 
 
  
   
  
  




in my struts config I have


  

and then


  

In my validation.xml file I have


  
  

  



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



Form validation over multiple pages

2003-05-29 Thread Brian McSweeney
Hi all,

I'm almost there with using the validator over several pages with a single form. 
However I'm getting a strange little error. The first page is validating fine, and it 
doesn't seem to try to validate the info required on the second page - correct. 
However once I try to validate the second page, the javascript validates correctly, 
but the server side validation returns an error saying the first page's required field 
needs validating. 

I think it might be because I'm not sure how to pass the page parameter to the action. 
I've tried using a html:hidden tag. Anyway, snippets from the jsps, struts config and 
validation.xml file are included below. 

If someone could help me out I'd be very grateful. Thanks very much,
Brian.




My first jsp named "validatestep1.jsp" looks like:






 username
  
 
 
  
   
  
  



My second jsp named "validatestep2.jsp" looks like





 
  credit card with no spaces or dashes
  
 
 
  
   
  
  




in my struts config I have


  

and then


  

In my validation.xml file I have


  
  

  



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]



form validation question

2003-03-20 Thread Andy Kriger
I have a validation rule that looks like this...





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: GET/POST in Actions & Form Validation

2003-03-07 Thread Stefan Arentz
On Friday, Mar 7, 2003, at 15:13 Europe/Amsterdam, [EMAIL PROTECTED] 
wrote:

You can set validate="false" and call the validation method from 
action if you
would..
try it.
Ah! Good advise. I didn't think of that :-/

I also got it to work with an extra action where validation was set to 
false, but doing the validation programatically is much nicer.

Thanks!

 S.

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


Re: GET/POST in Actions & Form Validation

2003-03-07 Thread modena
You can set validate="false" and call the validation method from action if you
would..
try it.


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



GET/POST in Actions & Form Validation

2003-03-07 Thread Stefan Arentz
Hi,

This is my first web app with Struts, so please be gentle :-)

I am trying to implement the following pattern:

 On GET:

  - Populate a form with fields OR show an empty form
  - Show the form
 On POST:

  - Validate the form, show it again if it has errors.

Very basic, but yet, I can't find the correct way to do this with 
Struts.

I have not seen one piece of example code that looks at the request 
method to make the distinction between showing the initial empty form 
(GET) or processing it (POST).

In my code I do basically this:

 execute()
 {
if (request.getMethod().compareTo("GET") == 0)
{
   ... code to setup the session ...
   return mapping.findForward("AddRecord"); // Shows the form
}
if (request.getMethod().compareTo("POST") == 0)
{
   ... execute some business logic ...
   return mapping.findForward("Success"); // Goes back to were we 
came from
}
  }

But the problem here is that when I forward to the AddRecord forward, 
the form is validated, which in case of an empty initial form will show 
errors for each field. I can set validate to false in my action 
definition but then validation is also skipped when I need it.

The forward is defined like this:

  

This must be very basic, but it is very difficult to find a clear 
answer in the large amount of Struts related resources :-/

 S.

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


RE: Repopulating FormFile field after form validation fails.

2003-02-28 Thread James Mitchell
No, you're doing it correctly.  There's a brief discussion about this
right now on the struts-dev list.
Struts will let you specify a value, but most browswers ignore it.

We will be documenting this better after tonight.



--
James Mitchell
Web Developer/Struts Evangelist
http://jakarta.apache.org/struts/



> -Original Message-
> From: Susan Bradeen [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 28, 2003 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: Repopulating FormFile field after form validation fails.
> 
> 
> In searching the archives, it appears that, by deliberate design for 
> security reasons, the FormFile field value cannot be 
> repopulated after 
> validation using the methods typical to other form fields. 
> The jsp page 
> source code shows a value for the field,
> 
>  value="org.apache.struts.upload.CommonsMultipartRequestHandler
> [EMAIL PROTECTED]">
> 
> but the field itself in the jsp is still blank. I am guessing this is 
> proper browser behavior. Maybe I am wrong already? If not, is there a 
> common work-around that I have missed for setting the 
>  value 
> with the user's original selection, or does everyone just 
> make the user 
> browse and select their file over again? 
> 
> An archive post on the subject:
> http://marc.theaimsgroup.com/?l=struts-user&m=102644179705188&w=2
> 
> Any comments are appreciated.
> 
> Susan Bradeen
> SoftLanding Systems, Inc
> [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]



Repopulating FormFile field after form validation fails.

2003-02-28 Thread Susan Bradeen
In searching the archives, it appears that, by deliberate design for 
security reasons, the FormFile field value cannot be repopulated after 
validation using the methods typical to other form fields. The jsp page 
source code shows a value for the field,



but the field itself in the jsp is still blank. I am guessing this is 
proper browser behavior. Maybe I am wrong already? If not, is there a 
common work-around that I have missed for setting the  value 
with the user's original selection, or does everyone just make the user 
browse and select their file over again? 

An archive post on the subject:
http://marc.theaimsgroup.com/?l=struts-user&m=102644179705188&w=2

Any comments are appreciated.

Susan Bradeen
SoftLanding Systems, Inc
[EMAIL PROTECTED]

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



RE: where to place form validation logic

2003-02-23 Thread Kola Oyedeji
Thats what i thought however reading the Wrox beginning JSP books, it states
on page 578 that "it is recommended to do the validation in the action
class"

I just wondered if the community agreed with this statement

Kola


> >-Original Message-
> >From: Ian Hunter [mailto:[EMAIL PROTECTED]
> >Sent: 20 February 2003 22:20
> >To: Struts Users Mailing List
> >Subject: Re: where to place form validation logic
> >
> >
> >Override the ActionForm.validate() method
> >
> >- Original Message -
> >From: "Kola Oyedeji" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Sent: Thursday, February 20, 2003 4:56 PM
> >Subject: where to place form validation logic
> >
> >
> >>
> >> Hi
> >>
> >> Just a quick question, where is the best place to put form validation
> >logic
> >> is assumed this was the role of the actionForm object but i
> >read somewhere
> >> that validation should be in the action object, is this true?
> >>
> >>
> >> Thanks
> >>
> >> Kola
> >>
> >>
> >> -
> >> 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

2003-02-21 Thread Joseph Fifield
if (this.isCancelled(request)) {
  return mapping.findForward("cancel");
}

Joe

> -Original Message-
> From: Geeta Ramani [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 21, 2003 9:06 AM
> To: Struts Users Mailing List
> Subject: Re: Form Validation
> 
> 
> Justin:
> 
> There is a html:cancel tag that you can use in your jsp which 
> (according to the docs) will indeed bypass the validate 
> method in the form bean and go directly to the action. In 
> your perform/execute method all you need to do is say something like:
> 
> if 
> (request.getParameter("org.apache.struts.taglib.html.CANCEL") 
> != null) {
> return mapping.findForward("cancel");
> }
> 
> Btw, I am working with Struts 1.02, maybe there's an even 
> slicker solution with 1.1..:)
> 
> regards,
> Geeta
> 
> "Justin F. Knotzke" wrote:
> 
> >Hi,
> >
> >I'd like to know if future versions of struts will have 
> the ability 
> > to return the form, with it's contents back to the input page after 
> > failing a validate.
> >
> >If I am going about it correctly, after performing a validate(), 
> > and upon returning with ActionErrors, the form is returned empty to 
> > the input page.
> >
> >The obvious 'workaround' is to put the form back into 
> the request.
> >
> >But it would be nice if one didn't have to do this.
> >
> >It would also be nice if struts had a property which you 
> could set 
> > (say inside the taglib) to tell validate() to not actually 
> validate, 
> > depending on the submit (ie, the user hit "cancel" no need to 
> > validate..
> >
> >Or is this already possible without having to code it by hand?
> >
> >Thanks
> >
> >Justin.
> >
> > --
> > Justin F. Knotzke
> > [EMAIL PROTECTED]
> > http://www.shampoo.ca
> >
> > 
> -
> > 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

2003-02-21 Thread Geeta Ramani
Justin:

There is a html:cancel tag that you can use in your jsp which (according to
the docs) will indeed bypass the validate method in the form bean and go
directly to the action. In your perform/execute method all you need to do is
say something like:

if (request.getParameter("org.apache.struts.taglib.html.CANCEL") != null) {
return mapping.findForward("cancel");
}

Btw, I am working with Struts 1.02, maybe there's an even slicker solution
with 1.1..:)

regards,
Geeta

"Justin F. Knotzke" wrote:

>Hi,
>
>I'd like to know if future versions of struts will have the ability
> to return the form, with it's contents back to the input page after
> failing a validate.
>
>If I am going about it correctly, after performing a validate(), and
> upon returning with ActionErrors, the form is returned empty to the input
> page.
>
>The obvious 'workaround' is to put the form back into the request.
>
>But it would be nice if one didn't have to do this.
>
>It would also be nice if struts had a property which you could set
> (say inside the taglib) to tell validate() to not actually validate,
> depending on the submit (ie, the user hit "cancel" no need to validate..
>
>Or is this already possible without having to code it by hand?
>
>Thanks
>
>Justin.
>
> --
> Justin F. Knotzke
> [EMAIL PROTECTED]
> http://www.shampoo.ca
>
> -
> 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

2003-02-21 Thread Justin F. Knotzke
On Thu, Feb 20, 2003 at 10:29:51PM -0500, Ian Hunter wrote:
> It seems to work "right" for me.

   That's nice.

   Are you saying that after validating a form and upon returning to the
input page your form has the data the user entered, without adding any
special code (as in manually adding the form to the request)?
 
   J.

-- 
Justin F. Knotzke
[EMAIL PROTECTED]
http://www.shampoo.ca

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




Re: Form Validation

2003-02-20 Thread Ian Hunter
It seems to work "right" for me.

- Original Message - 
From: "Justin F. Knotzke" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 10:27 PM
Subject: Form Validation


> 
> 
>Hi,
> 
>I'd like to know if future versions of struts will have the ability
> to return the form, with it's contents back to the input page after
> failing a validate. 
> 
>If I am going about it correctly, after performing a validate(), and
> upon returning with ActionErrors, the form is returned empty to the input
> page.
> 

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




Form Validation

2003-02-20 Thread Justin F. Knotzke


   Hi,

   I'd like to know if future versions of struts will have the ability
to return the form, with it's contents back to the input page after
failing a validate. 

   If I am going about it correctly, after performing a validate(), and
upon returning with ActionErrors, the form is returned empty to the input
page.

   The obvious 'workaround' is to put the form back into the request.

   But it would be nice if one didn't have to do this.

   It would also be nice if struts had a property which you could set
(say inside the taglib) to tell validate() to not actually validate,
depending on the submit (ie, the user hit "cancel" no need to validate..

   Or is this already possible without having to code it by hand?

   Thanks

   Justin.

-- 
Justin F. Knotzke
[EMAIL PROTECTED]
http://www.shampoo.ca

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




  1   2   3   >