is it possible to define a validation that runs only server side or client side (validation.xml )

2004-03-25 Thread Seyhan BASMACI \(Internet Yazilimlari Yetkilisi\)
I have a LoginForm form extends ValidatorForm and I want to decide 
a validaton runs only on the server or client side, (or both )
is there any way to do this_? 

 form name=LoginForm
  field property=userno depends=required
arg0 key=caption.wusernono/
  /field
 /form 

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



Re: is it possible to define a validation that runs only server side or client side (validation.xml )

2004-03-25 Thread ruben
Seyhan BASMACI (Internet Yazilimlari Yetkilisi) wrote:

I have a LoginForm form extends ValidatorForm and I want to decide 
a validaton runs only on the server or client side, (or both )
is there any way to do this_? 

form name=LoginForm
 field property=userno depends=required
   arg0 key=caption.wusernono/
 /field
/form 

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

hi,
if you want to call th javascript validation you only have to call the 
function
validateLoginForm(form); if you don't call this function, client side 
validation is not called.
the case of server side validation is more complex, if you only want to 
call the client side validation and not the server side, you have to 
overwrite the method validate of the ActionForm, and do nothing on it, 
returning null.

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


Server side Validation

2004-03-23 Thread Joao Batistella
Hello.

I'm using the Validator framework to validate user input and I'm having some
problems.

I've configured my form validation in the correct file.

The Javascript validation works fine but when I disable javascript
validation to see the server side validation behavior, I have the error
messages but without the field that generate the error, like this:
The field  is required.

Inside the  it was suposed to be the name that I configure in
ApplicationResources. How can Javascript validation works fine and server
side doesn't?

Thanks,
JP


Re: Validation Question with Indexed Properties

2004-03-22 Thread Craig Tataryn
friendly *bump*

On Sun, 21 Mar 2004 18:12:54 -0600 (CST), Craig Tataryn wrote:

 
 Hi, I have the following definition in my validation.xml file:
 
 formset
   form name=MarketAddressForm
   field
   property=provStateId
   indexedListProperty=address
   depends=required
   arg0 key=Listing.formError.streetProvState/
   /field
   /form
 /formset
 
 I then have a form that is built like so:
 % addressIndex = address( + region.getKey() + ); %
 html:select styleClass=Field property='%=addressIndex + .provStateId%'
 .
 .
 .
 /html:select
 
 This generates HTML that looks like:
 
 select name=address(355).provStateId class=Field
 .
 .
 .
 /select
 
 However, if I look at the javascript generated by html:javascript 
 formName=addressForm, I find:
 
  var bCancel = false; 
 
 function validateMarketAddressForm(form) {   
  
 
 
 if (bCancel) 
   return true; 
 else 
return validateRequired(form); 
} 
 
 function required () { 
 } 
 
 So does this mean that indexed properties for the validator do not work in 
 javascript?  Or am I
 doing something wrong?
 
 Thanks,
 
 Craig
 tataryn:craig/
 
 tataryn:craig/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


tataryn:craig/

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



Validation Question with Indexed Properties

2004-03-21 Thread Craig Tataryn
Hi, I have the following definition in my validation.xml file:

formset
form name=MarketAddressForm
field
property=provStateId
indexedListProperty=address
depends=required
arg0 key=Listing.formError.streetProvState/
/field
/form
/formset

I then have a form that is built like so:
% addressIndex = address( + region.getKey() + ); %
html:select styleClass=Field property='%=addressIndex + .provStateId%'
.
.
.
/html:select

This generates HTML that looks like:

select name=address(355).provStateId class=Field
.
.
.
/select

However, if I look at the javascript generated by html:javascript 
formName=addressForm, I find:

 var bCancel = false; 

function validateMarketAddressForm(form) { 
 

if (bCancel) 
  return true; 
else 
   return validateRequired(form); 
   } 

function required () { 
} 

So does this mean that indexed properties for the validator do not work in javascript? 
 Or am I
doing something wrong?

Thanks,

Craig
tataryn:craig/


tataryn:craig/

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



Re: validwhen validation question

2004-03-19 Thread Mah R
Is it possisble to use validwhen for date fields like comparing dates?
 


Brendan Richards [EMAIL PROTECTED] wrote:
I'm looking at using validwhen for a complex validation. 

I've got a value that can either be ignored when another parameter is
set or is valid when it's a date.

A simple date validation would be something like this:



datePatterndd-MM-var


Can a validwhen call another validation? Giving you something like





test
((ignoreDate == yes) or ( #insert date
validation# ))



or should I just write my own validation rule / do it with javascript
before I submit?



Thanks,

Brendan

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: Validator: Validation based on action path and not by form name

2004-03-18 Thread Adam Hardy
Kamakshya,
if you use the ValidatorActionForm instead of the ValidatorForm, then 
you can do this.

Adam

On 03/18/2004 08:26 AM Prasad, Kamakshya wrote:
Hi All,
 
Is it possible for validation.xml to take action path attribute instead
of form name for putting javascript validation rules for a page? 
 
I am having a page with lot of buttons, each mapping to a particular
action path. I want to validate the screen elements based on these
action paths and not as a whole form.
 
Please let me know if there is any such facility provided by struts.
 
Regards,
Kamakshya
 



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


RE: Validator: Validation based on action path and not by form name

2004-03-18 Thread Prasad, Kamakshya
Thanks Adam,

But what exactly I have to put in validation.xml

Now the xml has these lines 

formset
form name=assetForm

Should I change it to?

formset
action path=/resolveAsset

Regards
Kamakshya

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 18, 2004 7:19 PM
To: Struts Users Mailing List
Subject: Re: Validator: Validation based on action path and not by form
name

Kamakshya,
if you use the ValidatorActionForm instead of the ValidatorForm, then 
you can do this.

Adam

On 03/18/2004 08:26 AM Prasad, Kamakshya wrote:
 Hi All,
  
 Is it possible for validation.xml to take action path attribute
instead
 of form name for putting javascript validation rules for a page? 
  
 I am having a page with lot of buttons, each mapping to a particular
 action path. I want to validate the screen elements based on these
 action paths and not as a whole form.
  
 Please let me know if there is any such facility provided by struts.
  
 Regards,
 Kamakshya
  
 


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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



[partly answered] Re: Validator: Validation based on action path and not by form name

2004-03-18 Thread Axel Gross
Hi Kamakshya!

yes it is provided. just make it a ValidatorActionForm instead of a
ValidatorForm. (check docs for further info)
If you use DynaFormBeans, there is a DynaValdaterActionForm, but it never
worked for me...

hope this help,
Axel

On 2004-03-18 at 13:40:27 +0900, Prasad, Kamakshya wrote:
 Hi All,
  
 Is it possible for validation.xml to take action path attribute instead
 of form name for putting javascript validation rules for a page? 
  
 I am having a page with lot of buttons, each mapping to a particular
 action path. I want to validate the screen elements based on these
 action paths and not as a whole form.
  
 Please let me know if there is any such facility provided by struts.
  
 Regards,
 Kamakshya

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



Re: Validator: Validation based on action path and not by form name

2004-03-18 Thread Axel Groß
form name=/resolveAsset
as far as i can remember

On 2004-03-18 at 19:36:05 +0900, Prasad, Kamakshya wrote:
 Thanks Adam,
 
 But what exactly I have to put in validation.xml
 
 Now the xml has these lines 
 
 formset
   form name=assetForm
 
 Should I change it to?
 
 formset
   action path=/resolveAsset
 
 Regards
 Kamakshya
 
 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 18, 2004 7:19 PM
 To: Struts Users Mailing List
 Subject: Re: Validator: Validation based on action path and not by form
 name
 
 Kamakshya,
 if you use the ValidatorActionForm instead of the ValidatorForm, then 
 you can do this.
 
 Adam
 
 On 03/18/2004 08:26 AM Prasad, Kamakshya wrote:
  Hi All,
   
  Is it possible for validation.xml to take action path attribute
 instead
  of form name for putting javascript validation rules for a page? 
   
  I am having a page with lot of buttons, each mapping to a particular
  action path. I want to validate the screen elements based on these
  action paths and not as a whole form.
   
  Please let me know if there is any such facility provided by struts.
   
  Regards,
  Kamakshya
   
  
 
 
 -- 
 struts 1.1 + tomcat 5.0.16 + java 1.4.2
 Linux 2.4.20 Debian
 
 
 -
 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]



validwhen validation question

2004-03-18 Thread Brendan Richards
I'm looking at using validwhen for a complex validation. 
 
I've got a value that can either be ignored when another parameter is
set or is valid when it's a date.
 
A simple date validation would be something like this:
field property=date depends=required,date
arg0 key=myForm.date/
 
varvar-namedatePattern/var-namevar-valuedd-MM-/var-value/
var
/field
 
Can a validwhen call another validation? Giving you something like
 
 
field property=date depends=validwhen
  arg0 key=myform.date/
var
  var-nametest/var-name
  var-value((ignoreDate == yes) or ( #insert date
validation#  ))/var-value
/var
  /field
 
or should I just write my own validation rule / do it with javascript
before I submit?
 
 
 
Thanks,
 
Brendan


HowTo logical date validation

2004-03-18 Thread Frank Schaare
Hi all,

i´m looking for some kind of 'logical date validation' which means that 
dates like '2004-02-31' are filtered out and sent back to input page.

Has anyone ever done this before (i´m sure you have ;-)) ?
Are there any sites dealing with this problem ?
thanks for your reply...

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


Validator: Validation based on action path and not by form name

2004-03-17 Thread Prasad, Kamakshya
Hi All,
 
Is it possible for validation.xml to take action path attribute instead
of form name for putting javascript validation rules for a page? 
 
I am having a page with lot of buttons, each mapping to a particular
action path. I want to validate the screen elements based on these
action paths and not as a whole form.
 
Please let me know if there is any such facility provided by struts.
 
Regards,
Kamakshya


Validator: Validation based on action path and not by form name

2004-03-17 Thread Prasad, Kamakshya
Hi All,
 
Is it possible for validation.xml to take action path attribute instead
of form name for putting javascript validation rules for a page? 
 
I am having a page with lot of buttons, each mapping to a particular
action path. I want to validate the screen elements based on these
action paths and not as a whole form.
 
Please let me know if there is any such facility provided by struts.
 
Regards,
Kamakshya
 


AW: server side date validation

2004-03-16 Thread Andreas Solarik
I guess if one really, really wanted to, one could perform the validation in
java using something along the lines of the SimpleDateFormat class. Though I
do see the advantage of letting the validator handle the chore for you.

Andreas

-Ursprüngliche Nachricht-
Von: Anderson, James H [IT] [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 22:26
An: Struts Users Mailing List
Betreff: RE: server side date validation




formset
  form name=ActivityViewForm
field
   property=starting
   depends=date
  arg0 key=ActivityViewForm.starting.displayname/
  var
var-namedatePatternStrict/var-name
var-valueMM/dd//var-value
  /var
/field
 ...
 /form
   /formset

-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 2:04 PM
To: Struts Users Mailing List
Subject: server side date validation


Can anybody give me example code to validate date towards server side?


-Jignesh

-
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: validation

2004-03-16 Thread Axel Groß
ok, trying that on my machine (struts 1.1)
..at least bean:message bundle=alternate does find it
..no bundle attribute in field tag in this version
..there's a bundle attribute in the msg tag
..and it's plainly ignored
looks like a bug to me. 
ok, spent enough time on this...

hm in the commons they claim to be past version 1.1 ... though can't see any
related resource there
Frank, could you please check if the bug is in the bugtracker and if not,
file it??
And ask the validator people for putting the release on the server (and
please tell me if they did ;).

tschüss derweil,
Axel



On 2004-03-16 at 08:29:11 +0100, Otto, Frank wrote:
 Sorry, I use struts 1.1, but commons-validaton is version 1.0.2
 
 -Ursprüngliche Nachricht-
 Von: Axel Gross [mailto:[EMAIL PROTECTED]
 Gesendet: Dienstag, 16. März 2004 08:22
 An: Struts Users Mailing List
 Betreff: Re: validation
 
 
 hi!
 I don't if you problem is related to your version,
 do you really need struts 1.0?
 struts 1.1 you'll find under:
  http://jakarta.apache.org/site/binindex.cgi
 
 
 
 On 2004-03-16 at 07:50:22 +0100, Otto, Frank wrote:
  Thanks for your answer, but it doesn't function.
  
  I use struts-validation 1.0.2. Perhaps is this the problem? I don't find a newer 
  version on jakarte site. With nightly build it didn't validate my form.
  
  The same proplem I have with struts-config.xml. If I use bundle=alternate in my 
  action definitions, it will not be used.
  
  -Ursprüngliche Nachricht-
  Von: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
  Gesendet: Montag, 15. März 2004 13:43
  An: Struts Users Mailing List
  Betreff: RE: validation
  
  
  
  you can hve more than one resource bundle ..In struts-config file:
~  
  message-resources
  parameter=org.apache.struts.webapp.example.ApplicationResources/
  
message-resources
   
  parameter=org.apache.struts.webapp.example.AlternateApplicationResources
  key=alternate
/message-resources
  
  
  Then in validation.xml u can give like this for a specific form-field  a
  seperate resource bundle:
  
  field property=password
  depends=required, minlength,maxlength
  bundle=alternate
  
  and for otheres it will take the default bundle: applicationresources..
  
  Shobhana
  
  
  
  -Original Message-
  From: Otto, Frank [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 15, 2004 6:08 PM
  To: Struts-User (E-Mail)
  Subject: validation
  
  
  Hi,
   
  is there any possibility to use another resource bundle in validaton.xml? Or
  can I set somewhere which resources validation should use?
   
   
  Regards,
  Frank
  
  -
  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]



date validation problem

2004-03-16 Thread Jignesh Patel
On Tuesday 16 March 2004 21:03, Jignesh Patel wrote:
 When ever I am using method isDate of GenericValidator I am getting
 following error. Even for my date format 12-DEC-2004 I am getting same
 exception. I coudn't able to figure out what is the problem.

 -Jignesh


 ava.lang.IllegalArgumentException: Illegal pattern character 'O'
   java.text.SimpleDateFormat.compile(SimpleDateFormat.java:675)
   java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:494)
   java.text.SimpleDateFormat.init(SimpleDateFormat.java:443)
   java.text.SimpleDateFormat.init(SimpleDateFormat.java:424)
   com.bang.registration.RegistrationForm.checkDate(RegistrationForm.java:139
) com.bang.registration.RegistrationForm.validate(RegistrationForm.java:131)

 org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.
java:942)
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255
) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

 note


-
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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min} resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min} resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

-
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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min} resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

-
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: dtd validation of tld's

2004-03-15 Thread Adam Hardy
On 03/15/2004 12:52 AM hanasaki wrote:
I am using whatever is in tomcat 4.1.24.  Not sure what version of 
xerces that is or how to find out.
Neither am I, I'm afraid. Perhaps someone can jump in with the answer.




Funny thing is it worked some time ago.  The project just came out of 
5mo mothballs.



Adam Hardy wrote:

On 03/14/2004 08:59 PM hanasaki wrote:

Any thoughts on why Tomcat would be giving an error saying:

Digester error... SEVERE Parse error Document is invalid: no grammar 
found

This is happening on all TLD's.  They are JSTL and Struts.   I am 
thinking it has something to do with the DTD specified in the TLD as 
an http:... and having only intermittent Internet connectivity.  The 
need is to find away around this issue while still using xml 
validation and not modifying the TLD's from the downloaded distribution.

Are you using xerces 2.6.1?

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



--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
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.

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

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

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

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

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

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

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

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

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

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

arg1 name=intRange key=${var:min}
 resource=false/
arg2 name=intRange key=${var:max}
 resource=false/
  var
var-namemin/var-name
var-value${minYear}/var-value
  /var
  var
var-namemax/var-name
var-value${maxYear}/var-value
  /var


 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:
 html:form action=MyAction.do
 html:errors/
 html:text property=year/

 Struts-config:

 form-beans
 form-bean  name=myForm type=myForm/
 /form-beans
 action   path=MyAction 
   type=packageName/MyAction
   scope=request
   name=myForm
   input=myPage.jsp 
 forward name=success path=myPage.jsp/
 /action

 Validation.xml:

 form name=MyAction
   field property=year depends=required,integer,intRange
 arg0 key=MyAction.year/
 arg1 name=intRange key=${var:min}
 resource=false/
 var
 var-namemin/var-name
 var-value1900/var-value
 /var
/field
 /form




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

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

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

arg1 name=intRange key=${var:min}
 resource=false/
arg2 name=intRange key=${var:max}
 resource=false/
  var
var-namemin/var-name
var-value${minYear}/var-value
  /var
  var
var-namemax/var-name
var-value${maxYear}/var-value
  /var


 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:
 html:form action=MyAction.do
 html:errors/
 html:text property=year/

 Struts-config:

 form-beans
 form-bean  name=myForm type=myForm/
 /form-beans
 action   path=MyAction 
   type=packageName/MyAction
   scope=request
   name=myForm
   input=myPage.jsp 
 forward name=success path=myPage.jsp/
 /action

 Validation.xml:

 form name=MyAction
   field property=year depends=required,integer,intRange
 arg0 key=MyAction.year/
 arg1 name=intRange key=${var:min}
 resource=false/
 var
 var-namemin/var-name
 var-value1900/var-value
 /var
/field
 /form




 -
 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

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.

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

-
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: 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 
html:form action=MyAction.do onsubmit=return validateMyForm(this);

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

html:javascript formName=myForm/

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.

 arg1 name=intRange key=${var:min}
resource=false/
 arg2 name=intRange key=${var:max}
resource=false/
 var
   var-namemin/var-name
   var-value${minYear}/var-value
 /var
 var
   var-namemax/var-name
   var-value${maxYear}/var-value
 /var


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:
html:form action=MyAction.do
html:errors/
html:text property=year/
 
Struts-config:
 
form-beans
form-bean  name=myForm type=myForm/
/form-beans
action   path=MyAction 
  type=packageName/MyAction
  scope=request
  name=myForm
  input=myPage.jsp 
forward name=success path=myPage.jsp/ 
/action
 
Validation.xml:
 
form name=MyAction 
  field property=year depends=required,integer,intRange
arg0 key=MyAction.year/
arg1 name=intRange key=${var:min}
resource=false/
var
var-namemin/var-name
var-value1900/var-value
/var
   /field 
/form
 
 
 

-
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

Re: SV: Form Validation

2004-03-15 Thread Joe Hertz
Check the Bugzilla. I believe it works in the html:errors 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.
 
   arg1 name=intRange key=${var:min} 
  resource=false/
   arg2 name=intRange key=${var:max} 
  resource=false/
   var
 var-namemin/var-name
 var-value${minYear}/var-value
   /var
   var
 var-namemax/var-name
 var-value${maxYear}/var-value
   /var
 
 
  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:
  html:form action=MyAction.do
  html:errors/
  html:text property=year/
 
  Struts-config:
 
  form-beans
  form-bean  name=myForm type=myForm/ /form-beans
  action   path=MyAction 
type=packageName/MyAction
scope=request
name=myForm
input=myPage.jsp 
  forward name=success path=myPage.jsp/
  /action
 
  Validation.xml:
 
  form name=MyAction
field property=year 
 depends=required,integer,intRange
  arg0 key=MyAction.year/
  arg1 name=intRange key=${var:min} 
  resource=false/
  var
  var-namemin/var-name
  var-value1900/var-value
  /var
 /field
  /form
 
 
 
 
  
 -
  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: 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.

arg1 name=intRange key=${var:min}
 resource=false/
arg2 name=intRange key=${var:max}
 resource=false/
  var
var-namemin/var-name
var-value${minYear}/var-value
  /var
  var
var-namemax/var-name
var-value${maxYear}/var-value
  /var


 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:
 html:form action=MyAction.do
 html:errors/
 html:text property=year/

 Struts-config:

 form-beans
 form-bean  name=myForm type=myForm/
 /form-beans
 action   path=MyAction 
   type=packageName/MyAction
   scope=request
   name=myForm
   input=myPage.jsp 
 forward name=success path=myPage.jsp/
 /action

 Validation.xml:

 form name=MyAction
   field property=year depends=required,integer,intRange
 arg0 key=MyAction.year/
 arg1 name=intRange key=${var:min}
 resource=false/
 var
 var-namemin/var-name
 var-value1900/var-value
 /var
/field
 /form




 -
 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: 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
 field property=userName
depends=required, minlength,maxlength,mask
  msg  name=mask   
key=registrationForm.userName.maskmsg/
arg0   key=registrationForm.userName/
arg1   key=${var:minlength} name=minlength
   resource=false/
arg2   key=${var:maxlength} name=maxlength
   resource=false/
var
var-nameminlength/var-name
var-value5/var-value
/var

   var
var-namemask/var-name
var-value^[a-zA-Z]{1}[a-zA-Z0-9_]*$/var-value
   /var

var
var-namemaxlength/var-name
var-value15/var-value
/var
   /field

2. in Form class extend ValidatorForm

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

action  path=/saveRegistration type= registration.RegistrationAction 
name=registrationForm  validate=true input=/pages/index.jsp 
forward name=success path=/pages/profile.jsp/
forward name=failure path=/pages/index.jsp/
/action

4. in index.jsp 
head
html:javascript formName=registrationForm  /  
/head
after body put
html:form  action=/saveRegistration name=registrationForm 
type=com.bang.registration.RegistrationForm onsubmit=return 
validateRegistrationForm(this);

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.
 
   arg1 name=intRange key=${var:min}
  resource=false/
   arg2 name=intRange key=${var:max}
  resource=false/
   var
 var-namemin/var-name
 var-value${minYear}/var-value
   /var
   var
 var-namemax/var-name
 var-value${maxYear}/var-value
   /var
 
 
  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

validation

2004-03-15 Thread Otto, Frank
Hi,
 
is there any possibility to use another resource bundle in validaton.xml? Or can I set 
somewhere which resources validation should use?
 
 
Regards,
Frank


RE: validation

2004-03-15 Thread Shobhana.S, ASDC Chennai

you can hve more than one resource bundle ..In struts-config file:

message-resources
parameter=org.apache.struts.webapp.example.ApplicationResources/

  message-resources
 
parameter=org.apache.struts.webapp.example.AlternateApplicationResources
key=alternate
  /message-resources


Then in validation.xml u can give like this for a specific form-field  a
seperate resource bundle:

field property=password
depends=required, minlength,maxlength
bundle=alternate

and for otheres it will take the default bundle: applicationresources..

Shobhana



-Original Message-
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 6:08 PM
To: Struts-User (E-Mail)
Subject: validation


Hi,
 
is there any possibility to use another resource bundle in validaton.xml? Or
can I set somewhere which resources validation should use?
 
 
Regards,
Frank


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 html:errors 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. Mz 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.
  
  arg1 name=intRange key=${var:min}
   resource=false/
  arg2 name=intRange key=${var:max}
   resource=false/
var
  var-namemin/var-name
  var-value${minYear}/var-value
/var
var
  var-namemax/var-name
  var-value${maxYear}/var-value
/var
  
  
   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 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:
   html:form action=MyAction.do
   html:errors/
   html:text property=year/
  
   Struts-config:
  
   form-beans
   form-bean  name=myForm type=myForm/ /form-beans
   action   path=MyAction 
 type=packageName/MyAction
 scope=request
 name=myForm
 input=myPage.jsp 
   forward name=success path=myPage.jsp/
   /action
  
   Validation.xml:
  
   form name=MyAction
 field property=year
 
  depends=required,integer,intRange
 
   arg0 key=MyAction.year/
   arg1 name=intRange key=${var:min}
   resource=false/
   var
   var-namemin/var-name
   var-value1900/var-value
   /var
  /field
   /form
 
  -
 
   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 html:errors 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 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 html:errors 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 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 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 html:errors 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]


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 html:errors 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]



server side date validation

2004-03-15 Thread Jignesh Patel
Can anybody give me example code to validate date towards server side?  

-Jignesh

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



RE: server side date validation

2004-03-15 Thread Anderson, James H [IT]


formset
  form name=ActivityViewForm
field
   property=starting
   depends=date
  arg0 key=ActivityViewForm.starting.displayname/
  var
var-namedatePatternStrict/var-name
var-valueMM/dd//var-value
  /var
/field
 ...
 /form
   /formset

-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 2:04 PM
To: Struts Users Mailing List
Subject: server side date validation


Can anybody give me example code to validate date towards server side?  

-Jignesh

-
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: validation

2004-03-15 Thread Otto, Frank
Thanks for your answer, but it doesn't function.

I use struts-validation 1.0.2. Perhaps is this the problem? I don't find a newer 
version on jakarte site. With nightly build it didn't validate my form.

The same proplem I have with struts-config.xml. If I use bundle=alternate in my 
action definitions, it will not be used.

-Ursprüngliche Nachricht-
Von: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 13:43
An: Struts Users Mailing List
Betreff: RE: validation



you can hve more than one resource bundle ..In struts-config file:

message-resources
parameter=org.apache.struts.webapp.example.ApplicationResources/

  message-resources
 
parameter=org.apache.struts.webapp.example.AlternateApplicationResources
key=alternate
  /message-resources


Then in validation.xml u can give like this for a specific form-field  a
seperate resource bundle:

field property=password
depends=required, minlength,maxlength
bundle=alternate

and for otheres it will take the default bundle: applicationresources..

Shobhana



-Original Message-
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 6:08 PM
To: Struts-User (E-Mail)
Subject: validation


Hi,
 
is there any possibility to use another resource bundle in validaton.xml? Or
can I set somewhere which resources validation should use?
 
 
Regards,
Frank

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



Re: validation

2004-03-15 Thread Axel Gross
hi!
I don't if you problem is related to your version,
do you really need struts 1.0?
struts 1.1 you'll find under:
 http://jakarta.apache.org/site/binindex.cgi



On 2004-03-16 at 07:50:22 +0100, Otto, Frank wrote:
 Thanks for your answer, but it doesn't function.
 
 I use struts-validation 1.0.2. Perhaps is this the problem? I don't find a newer 
 version on jakarte site. With nightly build it didn't validate my form.
 
 The same proplem I have with struts-config.xml. If I use bundle=alternate in my 
 action definitions, it will not be used.
 
 -Ursprüngliche Nachricht-
 Von: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
 Gesendet: Montag, 15. März 2004 13:43
 An: Struts Users Mailing List
 Betreff: RE: validation
 
 
 
 you can hve more than one resource bundle ..In struts-config file:
 
   message-resources
 parameter=org.apache.struts.webapp.example.ApplicationResources/
 
   message-resources
  
 parameter=org.apache.struts.webapp.example.AlternateApplicationResources
 key=alternate
   /message-resources
 
 
 Then in validation.xml u can give like this for a specific form-field  a
 seperate resource bundle:
 
 field property=password
 depends=required, minlength,maxlength
 bundle=alternate
 
 and for otheres it will take the default bundle: applicationresources..
 
 Shobhana
 
 
 
 -Original Message-
 From: Otto, Frank [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 15, 2004 6:08 PM
 To: Struts-User (E-Mail)
 Subject: validation
 
 
 Hi,
  
 is there any possibility to use another resource bundle in validaton.xml? Or
 can I set somewhere which resources validation should use?
  
  
 Regards,
 Frank
 
 -
 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: validation

2004-03-15 Thread Otto, Frank
Sorry, I use struts 1.1, but commons-validaton is version 1.0.2

-Ursprüngliche Nachricht-
Von: Axel Gross [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 16. März 2004 08:22
An: Struts Users Mailing List
Betreff: Re: validation


hi!
I don't if you problem is related to your version,
do you really need struts 1.0?
struts 1.1 you'll find under:
 http://jakarta.apache.org/site/binindex.cgi



On 2004-03-16 at 07:50:22 +0100, Otto, Frank wrote:
 Thanks for your answer, but it doesn't function.
 
 I use struts-validation 1.0.2. Perhaps is this the problem? I don't find a newer 
 version on jakarte site. With nightly build it didn't validate my form.
 
 The same proplem I have with struts-config.xml. If I use bundle=alternate in my 
 action definitions, it will not be used.
 
 -Ursprüngliche Nachricht-
 Von: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
 Gesendet: Montag, 15. März 2004 13:43
 An: Struts Users Mailing List
 Betreff: RE: validation
 
 
 
 you can hve more than one resource bundle ..In struts-config file:
 
   message-resources
 parameter=org.apache.struts.webapp.example.ApplicationResources/
 
   message-resources
  
 parameter=org.apache.struts.webapp.example.AlternateApplicationResources
 key=alternate
   /message-resources
 
 
 Then in validation.xml u can give like this for a specific form-field  a
 seperate resource bundle:
 
 field property=password
 depends=required, minlength,maxlength
 bundle=alternate
 
 and for otheres it will take the default bundle: applicationresources..
 
 Shobhana
 
 
 
 -Original Message-
 From: Otto, Frank [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 15, 2004 6:08 PM
 To: Struts-User (E-Mail)
 Subject: validation
 
 
 Hi,
  
 is there any possibility to use another resource bundle in validaton.xml? Or
 can I set somewhere which resources validation should use?
  
  
 Regards,
 Frank
 
 -
 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]



urgent:multibox client side validation

2004-03-14 Thread Jignesh Patel
 Dear Friends,

 I have implemented multibox, everything is working fine.
 But I would like to validate the checkboxes, my purpose is atleast one
 checkbox will be selected from the user while submitting, if not message
 will be pop up.

 I am implementing javascript(client side) validation,



 My validation.xml contains following code

  field property=selectedMagazines depends=required
 arg0   key=interestsForm.selectedMagazines/
 /field

 I have tried the code, which is posted by Yuan as follows in
 validator-rule.xml, but it didn't worked out.


 function validateRequired(form) {
 var isValid = true;
 var focusField = null;
 var i = 0;
 var fields = new Array();
 oRequired = new required();

 for (x in oRequired) {
 var field = form[oRequired[x][0]];

 if (field.type == 'text' ||
 field.type == 'textarea' ||
 field.type == 'file' ||
 field.type == 'select-one' ||
 field.type == 'radio' || // -- true for single
 radio button, Saul Q Yuan ([EMAIL PROTECTED]) 10/28/03
 field.type == 'checkbox' || // -- true for
 single checkbox, Saul Q Yuan ([EMAIL PROTECTED]) 10/28/03
 field.type == 'password') {

 var value = '';
 // get field's value
 if (field.type == select-one) {
 var si = field.selectedIndex;
 if (si = 0) {
 value = field.options[si].value;
 }
 // -- get value for
 checked single radio button or checkbox, Saul Q Yuan
 ([EMAIL PROTECTED]) 10/28/03
 } else if (field.type ==
 radio || field.type == checkbox) {
if
 (field.checked) {
 value =
 field.value;
 }
 } else {
 value = field.value;
 }

 if (trim(value).length == 0) {

 if (i == 0) {
 focusField = field;
 }
 fields[i++] = oRequired[x][1];
 isValid = false;
 }
 } else if (field.type == select-multiple) {
 var numOptions = field.options.length;
 lastSelected=-1;
 for(loop=numOptions-1;loop=0;loop--) {
 if(field.options[loop].selected) {
 lastSelected = loop;
 value = field.options[loop].value;
 break;
 }
 }
 if(lastSelected  0 || trim(value).length == 0)
 {
 if(i == 0) {
 focusField = field;
 }
 fields[i++] = oRequired[x][1];
 isValid=false;
 }
 } else if ((field.length  0)  (field[0].type ==
 'radio' || field[0].type == 'checkbox')) {
 isChecked=-1;
 for (loop=0;loop  field.length;loop++) {
 if (field[loop].checked) {
 isChecked=loop;
 break; // only one needs to be checked
 }
 }
 if (isChecked  0) {
 if (i == 0) {
 focusField = field[0];
 }
 fields[i++] = oRequired[x][1];
 isValid=false;
 }
 }
 }
 if (fields.length  0) {
focusField.focus();
alert(fields.join('\n'));
 }
 return isValid;
 }


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



dtd validation of tld's

2004-03-14 Thread hanasaki
Any thoughts on why Tomcat would be giving an error saying:

Digester error... SEVERE Parse error Document is invalid: no grammar 
found

This is happening on all TLD's.  They are JSTL and Struts.   I am 
thinking it has something to do with the DTD specified in the TLD as an 
http:... and having only intermittent Internet connectivity.  The need 
is to find away around this issue while still using xml validation and 
not modifying the TLD's from the downloaded distribution.

Thanks

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


Re: dtd validation of tld's

2004-03-14 Thread Adam Hardy
On 03/14/2004 08:59 PM hanasaki wrote:
Any thoughts on why Tomcat would be giving an error saying:

Digester error... SEVERE Parse error Document is invalid: no grammar 
found

This is happening on all TLD's.  They are JSTL and Struts.   I am 
thinking it has something to do with the DTD specified in the TLD as an 
http:... and having only intermittent Internet connectivity.  The need 
is to find away around this issue while still using xml validation and 
not modifying the TLD's from the downloaded distribution.

Are you using xerces 2.6.1?

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


Re: dtd validation of tld's

2004-03-14 Thread hanasaki
I am using whatever is in tomcat 4.1.24.  Not sure what version of 
xerces that is or how to find out.

Funny thing is it worked some time ago.  The project just came out of 
5mo mothballs.



Adam Hardy wrote:
On 03/14/2004 08:59 PM hanasaki wrote:

Any thoughts on why Tomcat would be giving an error saying:

Digester error... SEVERE Parse error Document is invalid: no grammar 
found

This is happening on all TLD's.  They are JSTL and Struts.   I am 
thinking it has something to do with the DTD specified in the TLD as 
an http:... and having only intermittent Internet connectivity.  The 
need is to find away around this issue while still using xml 
validation and not modifying the TLD's from the downloaded distribution.

Are you using xerces 2.6.1?

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


Re: urgent:multibox client side validation

2004-03-14 Thread Saul Q Yuan
If you havn't done so, I'd suggest you view souce and see if you have the correct 
javascript code rendered in you jsp. If you set staticJavascript=true in your 
html:javascript ... tag, then the javascript should be rendered inside your jsp. You 
can even put in some alert box in your validator-rules.xml file to see if the required 
method actually gets called. BTW, do you have javascript validation working for other 
type of form fields?


Saul

- Original Message - 
  From: Jignesh Patel 
  To: [EMAIL PROTECTED] 
  Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; 
[EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Sunday, March 14, 2004 9:43 AM
  Subject: urgent:multibox client side validation


  Dear Friends,

   I have implemented multibox, everything is working fine.
   But I would like to validate the checkboxes, my purpose is atleast one
   checkbox will be selected from the user while submitting, if not message
   will be pop up.

   I am implementing javascript(client side) validation,



   My validation.xml contains following code

field property=selectedMagazines depends=required
   arg0   key=interestsForm.selectedMagazines/
   /field

   I have tried the code, which is posted by Yuan as follows in
   validator-rule.xml, but it didn't worked out.


   function validateRequired(form) {
   var isValid = true;
   var focusField = null;
   var i = 0;
   var fields = new Array();
   oRequired = new required();

   for (x in oRequired) {
   var field = form[oRequired[x][0]];

   if (field.type == 'text' ||
   field.type == 'textarea' ||
   field.type == 'file' ||
   field.type == 'select-one' ||
   field.type == 'radio' || // -- true for single
   radio button, Saul Q Yuan ([EMAIL PROTECTED]) 10/28/03
   field.type == 'checkbox' || // -- true for
   single checkbox, Saul Q Yuan ([EMAIL PROTECTED]) 10/28/03
   field.type == 'password') {

   var value = '';
   // get field's value
   if (field.type == select-one) {
   var si = field.selectedIndex;
   if (si = 0) {
   value = field.options[si].value;
   }
   // -- get value for
   checked single radio button or checkbox, Saul Q Yuan
   ([EMAIL PROTECTED]) 10/28/03
   } else if (field.type ==
   radio || field.type == checkbox) {
  if
   (field.checked) {
   value =
   field.value;
   }
   } else {
   value = field.value;
   }

   if (trim(value).length == 0) {

   if (i == 0) {
   focusField = field;
   }
   fields[i++] = oRequired[x][1];
   isValid = false;
   }
   } else if (field.type == select-multiple) {
   var numOptions = field.options.length;
   lastSelected=-1;
   for(loop=numOptions-1;loop=0;loop--) {
   if(field.options[loop].selected) {
   lastSelected = loop;
   value = field.options[loop].value;
   break;
   }
   }
   if(lastSelected  0 || trim(value).length == 0)
   {
   if(i == 0) {
   focusField = field;
   }
   fields[i++] = oRequired[x][1];
   isValid=false;
   }
   } else if ((field.length  0)  (field[0].type ==
   'radio' || field[0].type == 'checkbox')) {
   isChecked=-1;
   for (loop=0;loop  field.length;loop++) {
   if (field[loop].checked) {
   isChecked=loop;
   break; // only one needs to be checked
   }
   }
   if (isChecked  0

Re: urgent:multibox client side validation

2004-03-14 Thread Jignesh Patel
Yes Yuan,
It is working for all other function even password comparision also.
I need one more help for fixing password size I used minimum length but it is 
not working, may not supporting '* char. What need to be done for the same?

-Jignesh
On Monday 15 March 2004 06:43, Saul Q Yuan wrote:
 If you havn't done so, I'd suggest you view souce and see if you have the
 correct javascript code rendered in you jsp. If you set
 staticJavascript=true in your html:javascript ... tag, then the
 javascript should be rendered inside your jsp. You can even put in some
 alert box in your validator-rules.xml file to see if the required method
 actually gets called. BTW, do you have javascript validation working for
 other type of form fields?


 Saul

 - Original Message -
   From: Jignesh Patel
   To: [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] ;
 [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Sunday,
 March 14, 2004 9:43 AM
   Subject: urgent:multibox client side validation


   Dear Friends,

I have implemented multibox, everything is working fine.
But I would like to validate the checkboxes, my purpose is atleast one
checkbox will be selected from the user while submitting, if not message
will be pop up.

I am implementing javascript(client side) validation,



My validation.xml contains following code

 field property=selectedMagazines depends=required
arg0   key=interestsForm.selectedMagazines/
/field

I have tried the code, which is posted by Yuan as follows in
validator-rule.xml, but it didn't worked out.


function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();

for (x in oRequired) {
var field = form[oRequired[x][0]];

if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' || // -- true for single
radio button, Saul Q Yuan ([EMAIL PROTECTED]) 10/28/03
field.type == 'checkbox' || // -- true for
single checkbox, Saul Q Yuan ([EMAIL PROTECTED]) 10/28/03
field.type == 'password') {

var value = '';
// get field's value
if (field.type == select-one) {
var si = field.selectedIndex;
if (si = 0) {
value = field.options[si].value;
}
// -- get value for
checked single radio button or checkbox, Saul Q Yuan
([EMAIL PROTECTED]) 10/28/03
} else if (field.type ==
radio || field.type == checkbox) {
   if
(field.checked) {
value =
field.value;
}
} else {
value = field.value;
}

if (trim(value).length == 0) {

if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
}
} else if (field.type == select-multiple) {
var numOptions = field.options.length;
lastSelected=-1;
for(loop=numOptions-1;loop=0;loop--) {
if(field.options[loop].selected) {
lastSelected = loop;
value = field.options[loop].value;
break;
}
}
if(lastSelected  0 || trim(value).length == 0)
{
if(i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid=false;
}
} else if ((field.length  0)  (field[0].type ==
'radio' || field[0].type == 'checkbox')) {
isChecked=-1

RE: Validation failing when connected through Proxy???

2004-03-12 Thread Paul, R. Chip
Found some references to others with the same problem.  It seems the problem
usually pops up when you are using Apache mod_proxy to proxy a Struts app
with IE 6.0

I found another reference to calling invalidate on the sesison fixing this
problem.  It sounds to me like the session might not be getting set
correctly, but this problem only manifests on a few of our pages.  

The validation failing is as I suspected just the symptom of the problem -
either the parameters aren't making it to the server, or the bean isn't
getting populated.

This ringing any bells out there?

-Original Message-
From: Paul, R. Chip [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 11, 2004 5:49 PM
To: Struts User ([EMAIL PROTECTED])
Subject: Validation failing when connected through Proxy???


When testing our deployed app through a proxy server (clients - Proxy with
SSL, then through firewall to true server), we've run into a problem where
in some pages Validation fails for *some* clients.  It looks almost as if
all the form fields are blanked on submission.

The confusing part is that it happens consistently on some computers, but
not on others. The problem exists both with and without the same version of
I.E, on static or dynamic Ips, one same or different net address ranges
(10.* and 139.*), and on various OS's.

Has anyone seen this before, or can point me to some things to double check?
The app works fine for all users when not going through the proxy.

Chip Paul
Sr Software Engineer
ComFrame Software Corporation
 
Listen.Understand.Innovate
www.comframe.com
 

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

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



Re: upload validation failures are blanking my form values

2004-03-12 Thread Caoilte O'Connor
On Friday 12 March 2004 19:43, you wrote:
 Greetings,

 I was browsing through the Struts mail lists and found
 the thread that you started. I am having the exact same
 problem. Do you know of a work around or fix for this
 problem?

 TIA,

 Craig

user ignorance mate. i filed a bug,

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24503

you can voice your support and maybe someone in the team 
will have a look at it. Otherwise someone else emailed me a 
couple of monthes ago *rummages around*


--
I just ran into the same problem... and googled up your
unanswered query. But I think I just figured it out...

in the stuts config set the property for the file element to 
org.apache.struts.upload.FormFile not to java.lang.String.
Then in the action class or form or wherever you need to do 
it
cast it back from object.
Thats my guess. 

I bet you already figured that out. :)
--

To be honest, I'm not sure he even had the same problem as 
me, so I don't know if that will help you (it doesn't help 
me).

Let me know if you find a solution or persuade someone to 
fix it.

c

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



Re: upload validation failures are blanking my form values

2004-03-12 Thread Caoilte O'Connor
On Friday 12 March 2004 20:27, you wrote:
 Thanks for the reply. Nice to know I'm not alone. I found
 a suggested work around that involved using JavaScript to
 alter the HTML form's action attribute by appending the
 the values you want to remember as parameters. See
 http://mail-archives.apache.org/eyebrowse/ReadMsg?listId=
42msgNo=54731 for details.

 Happy sailing!

 Craig

aaah. Now I hate Javascript, but my colleague at work will 
love that hacked script you linked to. I'm gonna CC again 
to the struts list in the hope other people are also able 
to make good use of your good digging.

later,

c

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



Struts-Validation and Property file

2004-03-11 Thread Janarthan Sathiamurthy
Hi,
 
I am using Struts validator in my application. I have defined a properties file that 
has all the error messages for my application. I have mapped this file in my 
struts-config.xml file.
I have created a new rule specific for my application. I have mapped this in my 
validation-rules.xml.
Now, in my validation-rules.xml file, i want to specify the 'msg' parameter of the 
validator tag. I want Struts to read this ('msg' parameter value) from the 
properties file that i have created(the one that contains errors messages with key's 
mapped to them)
 
Please advice me on how do achieve this ?
 
Regards,
Janarthan S


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Re: Struts-Validation and Property file

2004-03-11 Thread Niall Pemberton
So in your validation-rules.xml you have something like...

validator name=myValidatorRule
classname=myPackage.MyValidator
 method=validateMyRule
 methodParams=java.lang.Object,
 org.apache.commons.validator.ValidatorAction,
 org.apache.commons.validator.Field,
 org.apache.struts.action.ActionErrors,
 javax.servlet.http.HttpServletRequest
 depends=
 msg=errors.myRule
/validator

In your properties file you define errors.myRule

In your MyValidator class you have something like

 public static boolean validateMyRule(Object bean,

ValidatorAction va,
   ActionErrors
errors,

HttpServletRequest request) {

boolean invalid =  /validation check
if (invalid) {
errors.add(field.getKey(), Resources.getActionError(request, va,
field));
}

 }


- Original Message - 
From: Janarthan Sathiamurthy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 11:15 AM
Subject: Struts-Validation and Property file


 Hi,

 I am using Struts validator in my application. I have defined a properties
file that has all the error messages for my application. I have mapped this
file in my struts-config.xml file.
 I have created a new rule specific for my application. I have mapped this
in my validation-rules.xml.
 Now, in my validation-rules.xml file, i want to specify the 'msg'
parameter of the validator tag. I want Struts to read this ('msg'
parameter value) from the properties file that i have created(the one that
contains errors messages with key's mapped to them)

 Please advice me on how do achieve this ?

 Regards,
 Janarthan S


 -
 Do you Yahoo!?
 Yahoo! Search - Find what you're looking for faster.



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



Problems with custom validation

2004-03-11 Thread Diego


Hi! I've created my own pluggable validator but it's not working. These are the
steps I've followed:

First: I added this to validator-rules.xml

validator name=nif
classname=com.pruebas.MTValidations
   method=validateNif
 methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionErrors,
   javax.servlet.http.HttpServletRequest
  depends=
  msg=errors.nif
/validator

Second: I created the class com.pruebas.MTValidations with a public static
boolean validateNif method.

Third: I added a errors.nif to my application resources file:

errors.nif='{0}' is not a valid NIF.

When I test it, the method validateNif is called, and returns true or false
correctly, but the validator seems to omit the result and always thinks the
value is OK. By the way, I also have a javascript tag which I've omitted here
and the client validation works OK, but the server validation refuses to work,
despite of the result returned by validateNif (it never calls the input
method). The standard validations (email, required, etc.) are working properly,
both client and server, in the same test and in the same conditions. 

Have I missed anything?

thanks in advance


This message was sent using IMP, the Internet Messaging Program.


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



Forget it (Problems with custom validation)

2004-03-11 Thread Diego


Sorry people, I was investigating that problem for no less than 2 hours and one
minute after I sent the message I saw that I wasn't adding errors (but shoulnd't
the validator deny the validation if the method is returning false, anyway?). I
solved it adding this line to the validateNif method:

errors.add(field.getKey(), Resources.getActionError(request, va, field));

bye!


This message was sent using IMP, the Internet Messaging Program.


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



Re: Problems with custom validation

2004-03-11 Thread Niall Pemberton
Whats in your validateNif method - are you adding a error to ActionErrors if
its invalid?

 errors.add(field.getKey(), Resources.getActionError(request, va, field));


- Original Message - 
From: Diego [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 12:56 PM
Subject: Problems with custom validation




 Hi! I've created my own pluggable validator but it's not working. These
are the
 steps I've followed:

 First: I added this to validator-rules.xml

 validator name=nif
 classname=com.pruebas.MTValidations
method=validateNif
  methodParams=java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest
   depends=
   msg=errors.nif
 /validator

 Second: I created the class com.pruebas.MTValidations with a public
static
 boolean validateNif method.

 Third: I added a errors.nif to my application resources file:

 errors.nif='{0}' is not a valid NIF.

 When I test it, the method validateNif is called, and returns true or
false
 correctly, but the validator seems to omit the result and always thinks
the
 value is OK. By the way, I also have a javascript tag which I've omitted
here
 and the client validation works OK, but the server validation refuses to
work,
 despite of the result returned by validateNif (it never calls the input
 method). The standard validations (email, required, etc.) are working
properly,
 both client and server, in the same test and in the same conditions.

 Have I missed anything?

 thanks in advance

 
 This message was sent using IMP, the Internet Messaging Program.


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



Validation failing when connected through Proxy???

2004-03-11 Thread Paul, R. Chip
When testing our deployed app through a proxy server (clients - Proxy with
SSL, then through firewall to true server), we've run into a problem where
in some pages Validation fails for *some* clients.  It looks almost as if
all the form fields are blanked on submission.

The confusing part is that it happens consistently on some computers, but
not on others.
The problem exists both with and without the same version of I.E, on static
or dynamic Ips, one same or different net address ranges (10.* and 139.*),
and on various OS's.

Has anyone seen this before, or can point me to some things to double check?
The app works fine for all users when not going through the proxy.

Chip Paul
Sr Software Engineer
ComFrame Software Corporation
 
Listen.Understand.Innovate
www.comframe.com
 

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



validator framework / multibox and javascript validation

2004-03-09 Thread harm
Hi all,

I have want to validate (client-side using javascript generated by the 
validator framework) if my user has at least selected one checkbox in my 
html:multibox form item.

Unfortunatly the javascript generator does not generate the JavaScript 
needed to validate this. 

I read somewhere on the mailinglist archive that this is a known issue 
with struts 1.1. The advice was to upgrade using a nightly build.
I tried to do so, but unfortunatly this does not work with the Tiles 
framework (which I'm also using in my application).

Can somebody tell me how to get this validation work?

Below provided my code:

I have a simple validator form:

public class SimpleForm extends ValidatorForm {
private String[] selectedItems;
 
public String[] getSelectedItems() {
return selectedItems;
}

public void setSelectedItems(String[] items) {
this.selectedItems = items;
}
}

And the following rule in validation.xml:

formset
  form name=simpleForm
  field property=selectedItems
 depends=required

  arg0 key=simpleForm.selectedItems/
  /field
  /form
/formset

I have the following JSP:

html:javascript formName=autoForm onsubmit=return 
validateSimpleForm(this);/
html:form action=/test
html:multibox property=selectedItems
bean:write name=car property=id/
/html:multibox
/html:form

Thanks,

Regards,

Harm de Laat
Informatiefabriek
The Netherlands

Multiple validation

2004-03-09 Thread Ruben Pardo
Hi, here is the scenario ...
i've got 4 different validation depending on 4
different javascript tab, i want to do a validation
depending on the tab that you are localized, ie, i
want to validate one field if the user is in the tab
1, other if the user are in tab 2 and so on.
I define in validation.xml 4 different form, and 
call some validate...Form(), or other depending of the
tab, but it doesn't work properly because some code
overwrite other, 
what i could do?
thanks, 


___
Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...
http://messenger.yahoo.es

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



dataPatterString e.g. 01JAN2003 - validation

2004-03-09 Thread bojke
Is there a Date validation option for a date in a format from a 
subject?  (DDMMM e.g. 02JAN2003)

Thanks,
Bojan
-
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 :

logic:iterate id=trade name=requestForm property=tradeColl
indexId=ctr 
html-el:text property=tradeQuantity[${trade}] /
/logic:iterate

giving form fields ...

input type=text name=tradeQuantity[0]
input type=text name=tradeQuantity[1]
input type=text name=tradeQuantity[2]
etc ...

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

 field property=tradeQuantity[0] depends=integer page=3
arg0 key=request.tradequantity.displayname/
 /field
 --- 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: Struts Form Validation

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

 field property=tradeQuantity indexedListProperty=myCollection
depends=integer page=3
arg0 key=request.tradequantity.displayname/
 /field

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 :

 logic:iterate id=trade name=requestForm property=tradeColl
 indexId=ctr 
 html-el:text property=tradeQuantity[${trade}] /
 /logic:iterate

 giving form fields ...

 input type=text name=tradeQuantity[0]
 input type=text name=tradeQuantity[1]
 input type=text name=tradeQuantity[2]
 etc ...

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

  field property=tradeQuantity[0] depends=integer page=3
 arg0 key=request.tradequantity.displayname/
  /field
  --- 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]



URL validation - anyone using it?

2004-03-05 Thread Adam Hardy
I'm looking at providing URL validation on a page which saves links for 
users.

I put together the latest build of commons-validator (1.1.2) and struts 
(1.2) to see what the URL validation is like.

The class for server-side validation is in place, but the javascript 
doesn't exist.

It works very strictly, too strictly for me.

Most users will want to save links such as

http://www.google.com
http://jakarta.apache.org/
http://marc.theaimsgroup.com/?l=struts-userm=105511005106573w=2
none of which pass the urlValidator test. Only this format works:

http://authority.com/filename

I can put UrlValidator.java in my source code and modify it for my 
purposes, but I would like to know if there is anyone else interested or 
even actively working on this? Perhaps I should post this to the 
struts-dev list.

Adam

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


Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Wendy Smoak

I'm using the same [dynamic] ActionForm on all my pages.  Which was just
*fine* until I wanted to use validation. :(

I need separate validation per tab which is essentially a forward
tag in struts-config.

I have a Struts-Menu tab that has fields for fund, function and cost
center, which are elements of an account, and I string the bits together
later.

Another tab has radio buttons where they pick an account.

On the first, I need all three fields to be required.  But if I do that
in validation.xml, then the second page complains that the three fields
are required.

I understand what's happening, I just don't know the best way to fix it.
I'm using 1.2.0, if there's something new that might be of use.

I found this, advocating DynaValidatorActionForm
http://www.mail-archive.com/[EMAIL PROTECTED]/msg93220.html
But it seems to be controlled by the path, which is going to be the same
in both cases.  

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



RE: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Robert Taylor
Are you using DispatchAction or LookupDispatchAction? 

robert



 -Original Message-
 From: Wendy Smoak [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 05, 2004 1:24 PM
 To: Struts Users Mailing List
 Subject: Validation help for same Form, multiple pages/tabs
 
 
 
 I'm using the same [dynamic] ActionForm on all my pages.  Which was just
 *fine* until I wanted to use validation. :(
 
 I need separate validation per tab which is essentially a forward
 tag in struts-config.
 
 I have a Struts-Menu tab that has fields for fund, function and cost
 center, which are elements of an account, and I string the bits together
 later.
 
 Another tab has radio buttons where they pick an account.
 
 On the first, I need all three fields to be required.  But if I do that
 in validation.xml, then the second page complains that the three fields
 are required.
 
 I understand what's happening, I just don't know the best way to fix it.
 I'm using 1.2.0, if there's something new that might be of use.
 
 I found this, advocating DynaValidatorActionForm
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg93220.html
 But it seems to be controlled by the path, which is going to be the same
 in both cases.  
 
 -- 
 Wendy Smoak
 Application Systems Analyst, Sr.
 ASU IA Information Resources Management 
 
 -
 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: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Wendy Smoak
Robert wrote:
 Are you using DispatchAction or LookupDispatchAction? 

LookupDispatchAction.  And even worse, it's a cookie that controls which
tab to show, not always a request parameter.  I think I may have
painted myself into a corner...

-Wendy Smoak

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



RE: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Robert Taylor
Okay. Here is what I do which may or may not help.

I have subclassed DispatchAction to handle image buttons. 
The newer Struts version may handle this, but it didn't prior
to 1.1. Image buttons may not be your problem but it has a special
method to extract the dispatched operation. 
Anyhow you can see the implementation here.

http://issues.apache.org/bugzilla/show_bug.cgi?id=19925


I also subclass DynaValidatorActionForm which uses the static method defined
in ImageButtonDispatchAction to extract the operation parameter.

 /**
 * Validate the properties that have been set from this HTTP request,
 * and return an codeActionErrors/code object that encapsulates any
 * validation errors that have been found.  If no errors are found, return
 * codenull/code or an codeActionErrors/code object with no
 * recorded error messages.
 *
 * @param mapping The mapping used to select this instance.
 * @param request The servlet request we are processing.
 * @return ActionErrors containing validation errors.
 */
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
// set the page variable before validating
Map props = this.getMap();
if (props.containsKey(page)) {
this.page = ((Integer) props.get(page)).intValue();
}

ServletContext application = getServlet().getServletContext();
ActionErrors errors = new ActionErrors();
String validationKey = this.getValidationKey(mapping, request);

logger.fine(validationKey:  + validationKey);

Validator validator =
Resources.initValidator(
validationKey, this, application, request, errors, page);
logger.fine(validator:  + validator.getClass().getName());

try {
validatorResults = validator.validate();
} catch (ValidatorException e) {
log.error(e.getMessage(), e);
}

return errors;
}


/**
 * Get the validation key used to determine which validation
 * rules will be executed. 
 * 
 * @return the validation key
 */
protected String getValidationKey(ActionMapping mapping, HttpServletRequest 
request) {

String path = mapping.getPath(); 
String parameter = mapping.getParameter();

if (parameter == null) {

return path;

}

String operation = ImageButtonDispatchAction.getOperation(parameter, 
request);
return  MessageFormat.format(
VALIDATION_KEY_TEMPLATE, new Object[]{path, 
operation});


}




This allows me to have validation keys of the form: path-operation.
So in my validation.xml I have form elements that look somewhat like:

form name=/applications/account/doSaveChanges-create

/form

form name=/applications/account/doSaveChanges-update

/form

As you can see, the same action mapping path is used but the operation
is appended to them allowing for more granular validations.

This may not be the best way to handle things, but I've been using
this approach for a couple years and it works quite well. 


robert


 -Original Message-
 From: Wendy Smoak [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 05, 2004 2:00 PM
 To: Struts Users Mailing List
 Subject: RE: Validation help for same Form, multiple pages/tabs
 
 
 Robert wrote:
  Are you using DispatchAction or LookupDispatchAction? 
 
 LookupDispatchAction.  And even worse, it's a cookie that controls which
 tab to show, not always a request parameter.  I think I may have
 painted myself into a corner...
 
 -Wendy Smoak
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



RE: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Pingili, Madhupal
Well, It's not too hard to convert the LookupDispatchAction into
separate Actions for you Wendy. Of course, I don't know the processing logic
in LookupDispatchAction.
I am using DynaValidatorActionForms and I validate based on the action path.
I have 4 struts-menu tabs linking to 4 different actions.
It's working great so far.

Reddy Pingili 

 -Original Message-
 From: Wendy Smoak [SMTP:[EMAIL PROTECTED]
 Sent: Friday, March 05, 2004 2:00 PM
 To:   Struts Users Mailing List
 Subject:  RE: Validation help for same Form, multiple pages/tabs
 
 Robert wrote:
  Are you using DispatchAction or LookupDispatchAction? 
 
 LookupDispatchAction.  And even worse, it's a cookie that controls which
 tab to show, not always a request parameter.  I think I may have
 painted myself into a corner...
 
 -Wendy Smoak
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



RE: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread as as
If possible.could you encose the snippet please!
Thanks!

Pingili, Madhupal [EMAIL PROTECTED] wrote:Well, It's not too hard to convert the 
LookupDispatchAction into
separate Actions for you Wendy. Of course, I don't know the processing logic
in LookupDispatchAction.
I am using DynaValidatorActionForms and I validate based on the action path.
I have 4 struts-menu tabs linking to 4 different actions.
It's working great so far.

Reddy Pingili 

 -Original Message-
 From: Wendy Smoak [SMTP:[EMAIL PROTECTED]
 Sent: Friday, March 05, 2004 2:00 PM
 To: Struts Users Mailing List
 Subject: RE: Validation help for same Form, multiple pages/tabs
 
 Robert wrote:
  Are you using DispatchAction or LookupDispatchAction? 
 
 LookupDispatchAction. And even worse, it's a cookie that controls which
 tab to show, not always a request parameter. I think I may have
 painted myself into a corner...
 
 -Wendy Smoak
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

RE: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Joe Hertz
Wendy,

I'm not getting something (and it's me being dense I'm sure).

It sounds to me like you've found yourself in a position where you are 
pushing the limits of the validation framework.

What would be the problem with biting the bullet and implementing validate() 
in your ActionForm and calling super.validate(mapping, request) if it was 
appropriate to hit the xml file for the validation rules?

-Joe

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 05, 2004 1:24 PM
To: Struts Users Mailing List
Subject: Validation help for same Form, multiple pages/tabs


I'm using the same [dynamic] ActionForm on all my pages.  Which was just
*fine* until I wanted to use validation. :(

I need separate validation per tab which is essentially a forward
tag in struts-config.

I have a Struts-Menu tab that has fields for fund, function and cost
center, which are elements of an account, and I string the bits together
later.

Another tab has radio buttons where they pick an account.

On the first, I need all three fields to be required.  But if I do that
in validation.xml, then the second page complains that the three fields
are required.

I understand what's happening, I just don't know the best way to fix it.
I'm using 1.2.0, if there's something new that might be of use.

I found this, advocating DynaValidatorActionForm
http://www.mail-archive.com/[EMAIL PROTECTED]/msg93220.html
But it seems to be controlled by the path, which is going to be the same
in both cases.  

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

-
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: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Pingili, Madhupal
I must say that I am not dealing with multiple pages.
But adding that feature shouldn't be a problem.
Here they are:

validation.xml :


  formname=/findLoans
 fieldproperty=accountNo
   depends=required,numCheck
 arg0
key=prepareSearchPageForm.accountno.displayname/
 arg1 name=numCheck key=${var:fieldLength1}
resource=false/
 arg2 name=numCheck key=${var:fieldLength2}
resource=false/
 var
   var-namefieldLength1/var-name
   var-value10/var-value
 /var
 var
   var-namefieldLength2/var-name
   var-value13/var-value
 /var
 /field
  /form
  formname=/findVisaMc
field property=accountNo
depends=required, minlength,maxlength
arg0   key=prepareSearchPageForm.accountno.displayname/
arg1   key=${var:minlength} name=minlength
   resource=false/
arg2   key=${var:maxlength} name=maxlength
   resource=false/
var
var-namemaxlength/var-name
var-value16/var-value
/var
var
var-nameminlength/var-name
var-value16/var-value
/var
/field
  /form

--

Struts-config.xml :

-
form-bean  name=prepareSearchPageForm
  type=org.apache.struts.validator.DynaValidatorActionForm
  form-property name=accountNo type=java.lang.String/
/form-bean

action   path=/findLoans
  type=com.bbandt.imagesys.docretrieval.action.FindLoansAction
  name=prepareSearchPageForm
  scope=request
  input=/FindLoans.jsp validate=true
   forward name=success path=/FindLoansResults.jsp/
   forward name=main path=/FindLoansResultsMain.jsp/
/action

action   path=/findVisaMc
 
type=com.bbandt.imagesys.docretrieval.action.FindVisaMcAction
  name=prepareSearchPageForm
  scope=request
  input=/FindVisaMc.jsp validate=true
   forward name=success path=/FindLoansResults.jsp/
   forward name=main path=/FindLoansResultsMain.jsp/
/action

-


Hope this helps.

Reddy Pingili
   
 -Original Message-
 From: as as [SMTP:[EMAIL PROTECTED]
 Sent: Friday, March 05, 2004 2:49 PM
 To:   Struts Users Mailing List
 Subject:  RE: Validation help for same Form, multiple pages/tabs
 
 If possible.could you encose the snippet please!
 Thanks!
 
 Pingili, Madhupal [EMAIL PROTECTED] wrote:Well, It's not too hard to
 convert the LookupDispatchAction into
 separate Actions for you Wendy. Of course, I don't know the processing
 logic
 in LookupDispatchAction.
 I am using DynaValidatorActionForms and I validate based on the action
 path.
 I have 4 struts-menu tabs linking to 4 different actions.
 It's working great so far.
 
 Reddy Pingili 
 
  -Original Message-
  From: Wendy Smoak [SMTP:[EMAIL PROTECTED]
  Sent: Friday, March 05, 2004 2:00 PM
  To: Struts Users Mailing List
  Subject: RE: Validation help for same Form, multiple pages/tabs
  
  Robert wrote:
   Are you using DispatchAction or LookupDispatchAction? 
  
  LookupDispatchAction. And even worse, it's a cookie that controls which
  tab to show, not always a request parameter. I think I may have
  painted myself into a corner...
  
  -Wendy Smoak
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Search - Find what you're looking for faster.

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



RE: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Wendy Smoak
 From: Joe Hertz [mailto:[EMAIL PROTECTED] 
 What would be the problem with biting the bullet and 
 implementing validate() 
 in your ActionForm and calling super.validate(mapping, 
 request) if it was 
 appropriate to hit the xml file for the validation rules?

I already do that, to step around validation unless the form is POSTed.

The problem is that, as I have it now, there is only one set of
validation rules for the form.  So the page with only radio buttons
complains about the missing fund/function/cost center fields, and vice
versa.  In a perfect world, it would somehow know what fields were on
the form and only check those. :)

However, I think I've got it down to using both DynaValidatorActionForm
*and* the new MappingDispatchAction.  That will mean I can have totally
different URLs for each tab and still have all the methods in one
place.  

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 


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



Re: Validation help for same Form, multiple pages/tabs

2004-03-05 Thread Niall Pemberton
Wendy,

Validator has the concept of a page number - so your first tab could be
page 1, second tab page 2 etc etc.

On each tab's form specify a hidden tag with the page number:
   html:hidden name=myForm property=page value=1/

Then in your validation.xml, you specify the page number for each field:

   form name=..
field property=fund page=1.
field property=function  page=1.
field property=costCenter page=1.
field property=account page=2.

Obviously as you're using the DynaActionForm, you need to add 'page' as a
property to the form.

Niall

- Original Message - 
From: Wendy Smoak [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, March 05, 2004 6:23 PM
Subject: Validation help for same Form, multiple pages/tabs



I'm using the same [dynamic] ActionForm on all my pages.  Which was just
*fine* until I wanted to use validation. :(

I need separate validation per tab which is essentially a forward
tag in struts-config.

I have a Struts-Menu tab that has fields for fund, function and cost
center, which are elements of an account, and I string the bits together
later.

Another tab has radio buttons where they pick an account.

On the first, I need all three fields to be required.  But if I do that
in validation.xml, then the second page complains that the three fields
are required.

I understand what's happening, I just don't know the best way to fix it.
I'm using 1.2.0, if there's something new that might be of use.

I found this, advocating DynaValidatorActionForm
http://www.mail-archive.com/[EMAIL PROTECTED]/msg93220.html
But it seems to be controlled by the path, which is going to be the same
in both cases.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management

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



dynamic validation

2004-03-01 Thread Bubeník Miroslav
Hi,
does anybody have idea, how can I dynamicaly change, which field from form will be 
validated against validation defined in validation.xml?
Which field should be validated will be determined on data from DB or other source
 
Regards
 
miro


Manipulate page validation for ValidatorForm

2004-02-27 Thread Mikael Wikblom
Hi,

I have the following problem; the page validation of the ValidatiorForm 
requires that the pages are ordered (e.g. a wizard-initalization) and 
performs validation for all pages = current page. If a page is 
undefined or 0, validation for all pages is performed.

In my application I have an intialization that requires this 
functionality, but the pages I have are not ordered, making the 
validation of current page and all pages before invalid. What I do need 
is validation for page = current page and not the ones before.

Is this somehow possible without loosing the normal (validation.xml 
entries) validation? I'm using struts version 1.1.

Thanks



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


RE: Manipulate page validation for ValidatorForm

2004-02-27 Thread Hookom, Jacob
We had to do this for our last project; I had an ActionForm for each page
with validator bindings to validate input on each page.  In the Actions, I
used the page's form to update a transaction bean in the session which I
in turn called a commit method on it to execute business logic (validate
product inventory/medical information/etc). The commit method then could
throw business exceptions which I bound to exception handlers.

I referred to it as conflict-resolution where your goal is a successful
commit of the transaction, but for any conflict, you resolve with a UI
page and separate action form to validate user's data.  Any input validation
would be taken care of by each page's ActionForm.


ActionForward execute(..) throws Exception
{
TransactionSession tx = getTransaction(httpSession);
tx.setQuantity(new Integer(form.getQuantity()));
tx.commit()
return mapping.findForward(SUCCESS);
}

-Jacob

-Original Message-
From: Mikael Wikblom [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 8:22 AM
To: [EMAIL PROTECTED]
Subject: Manipulate page validation for ValidatorForm

Hi,

I have the following problem; the page validation of the ValidatiorForm 
requires that the pages are ordered (e.g. a wizard-initalization) and 
performs validation for all pages = current page. If a page is 
undefined or 0, validation for all pages is performed.

In my application I have an intialization that requires this 
functionality, but the pages I have are not ordered, making the 
validation of current page and all pages before invalid. What I do need 
is validation for page = current page and not the ones before.

Is this somehow possible without loosing the normal (validation.xml 
entries) validation? I'm using struts version 1.1.

Thanks




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

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



Re: Manipulate page validation for ValidatorForm

2004-02-27 Thread Mikael Wikblom
Hi Jacob,

yes it is possible to solve this in a number of ways. I just wanted to 
know if the is an easy way of doing it. I've looked at the 
struts/validatior implemtentation, it would only mean changing one line 
of code ( a = to a =  ) to have my desired behaviour. It would not be 
hard to make this an attribute of the ValidatiorForm. I mean making the 
assumption that the pages always are ordered is not the most generic 
approach ;)

Thanks anyway!

Hookom, Jacob wrote:

We had to do this for our last project; I had an ActionForm for each page
with validator bindings to validate input on each page.  In the Actions, I
used the page's form to update a transaction bean in the session which I
in turn called a commit method on it to execute business logic (validate
product inventory/medical information/etc). The commit method then could
throw business exceptions which I bound to exception handlers.
I referred to it as conflict-resolution where your goal is a successful
commit of the transaction, but for any conflict, you resolve with a UI
page and separate action form to validate user's data.  Any input validation
would be taken care of by each page's ActionForm.
ActionForward execute(..) throws Exception
{
TransactionSession tx = getTransaction(httpSession);
tx.setQuantity(new Integer(form.getQuantity()));
tx.commit()
return mapping.findForward(SUCCESS);
}
-Jacob

-Original Message-
From: Mikael Wikblom [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 27, 2004 8:22 AM
To: [EMAIL PROTECTED]
Subject: Manipulate page validation for ValidatorForm

Hi,

I have the following problem; the page validation of the ValidatiorForm 
requires that the pages are ordered (e.g. a wizard-initalization) and 
performs validation for all pages = current page. If a page is 
undefined or 0, validation for all pages is performed.

In my application I have an intialization that requires this 
functionality, but the pages I have are not ordered, making the 
validation of current page and all pages before invalid. What I do need 
is validation for page = current page and not the ones before.

Is this somehow possible without loosing the normal (validation.xml 
entries) validation? I'm using struts version 1.1.

Thanks



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



--
+-+
Mikael Wikblommailto:[EMAIL PROTECTED]
Senior Software Engineer  MoS in Computer Sci. and Eng., LiTH
AdNovum Informatik AG http://www.adnovum.ch  phone: +41 (0)1 272 6111
Roentgenstrasse 22, CH-8005 Zuerich  fax:   +41 (0)1 272 6312
+-+
AdNovum Software Inc. San Mateo, CA 94404phone: +1 (650) 525 9322
1400 Fashion Island Boulevard, Suite 309 fax:   +1 (650) 525 9324
+-+


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


ValidatorActionForm cannot generate javascript validation code

2004-02-26 Thread Julio Cesar De Salvo
It Works great with ValidatorForm but with ValidatorActionForm I can't
make it work, this is my code:
 
Struts-config.xml
..
action path=/saveProyectoVersiones
 
type=org.itechnology.actions.SaveProyectoVersionesAction
name=proyectoForm
scope=request
 
input=proyecto_versiones
  forward name=success
path=/editProyectoVersiones.do?action=Create/
  forward name=proyecto_versiones
path=/proyecto_versiones.jsp/
/action
...
 
validation.xml
 
...
form name=/saveProyectoVersiones
field
property=descripcionVersion
   depends=required
 arg0 key=prompt.descripcion/
/field
/form
...
 
and the class ProyectoForm.java
 
..
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.validator.ValidatorActionForm;
import org.apache.struts.action.ActionMapping;
 
public final class ProyectoForm extends ValidatorActionForm {
 
 
// --- Instance
Variables
 
 
/**
 * The maintenance action we are performing (Create or Edit).
 */
private String action = Create;
private String index = null;
...
 
and the .jsp file
 
...
html:form action=/saveProyectoVersiones onsubmit=return
validateProyectoForm();
html:hidden property=action/
table border=0 width=100% cellspacing=0
cellpadding=0
.
/html:form
 
html:javascript formName=proyectoForm
dynamicJavascript=true
 staticJavascript=false/
script language=Javascript1.1 src=staticJavascript.jsp/script
 
/html:html
 
 
 


validation error in FormBean, where to redirect next?

2004-02-25 Thread Marco Mistroni
Hi all,
Assume that I have following struts-config.xml

action path=/receiveLine 
  type= ReceiveLineAction 
  input=/receiveLine.jsp 
  name=receiveLineForm scope=request
forward name=failure path=/receiveLine.jsp
/forward
forward name=exitLine
path=/receiveHeader.jsp
/forward
forward name=lineComplete
path=/populateProduct.do
/forward
/action

Now, I have ALWAYS assumed that if validation fails in the
ReceiveLIneForm bean, I should be redirected to the input page, which is
receiveLine.jsp

Is my assumption correct?

Regards]
Marco



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



Re: validation error in FormBean, where to redirect next?

2004-02-25 Thread Niall Pemberton
Yes
- Original Message - 
From: Marco Mistroni [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 10:51 AM
Subject: validation error in FormBean, where to redirect next?


 Hi all,
 Assume that I have following struts-config.xml
 
 action path=/receiveLine  
   type= ReceiveLineAction 
   input=/receiveLine.jsp 
   name=receiveLineForm scope=request
 forward name=failure path=/receiveLine.jsp
 /forward
 forward name=exitLine
 path=/receiveHeader.jsp
 /forward
 forward name=lineComplete
 path=/populateProduct.do
 /forward
 /action
 
 Now, I have ALWAYS assumed that if validation fails in the
 ReceiveLIneForm bean, I should be redirected to the input page, which is
 receiveLine.jsp
 
 Is my assumption correct?
 
 Regards]
 Marco
 
 
 
 -
 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]



Validation doubt?

2004-02-24 Thread subramaniam . o

Hi,
I
do not want to validate my form when the user clicks the Cancel button.
For your information im not using _javascript_
validation [i.e my doesnt've html:_javascript_ formname=someform]
how to do this?

Subramaniam Olaganthan
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.comDISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the
addressee. Unauthorized use, disclosure or copying is strictly prohibited and may 
constitute unlawful act and can possibly attract legal action, civil and/or criminal. 
The contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services
on any subject matter. Any action taken or omitted to be taken based on this message 
is entirely at your risk and neither the originator of this message nor Tata 
Consultancy Services takes any responsibility or liability towards the same. Opinions, 
conclusions and any other
information contained in this message that do not relate to the official business of 
Tata Consultancy Services shall be understood as neither given nor endorsed by Tata 
Consultancy Services or any affiliate of Tata Consultancy Services. If you have 
received this message in error,
you should destroy this message and may please notify the sender by e-mail. Thank you.


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

RE: Validation doubt?

2004-02-24 Thread Angharad Stapleton
Have the submit button has a form property. Then when validating only valid
if submit button was hit.

e.g. if ((this.getSubmitButton() != null)  (!(
this.getSubmitButton().equals({
   ... validation code
   }
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: 24 February 2004 16:21
  To: [EMAIL PROTECTED]
  Subject: Validation doubt?



  Hi,
  I do not want to validate my form when the user clicks the Cancel
button.
  For your information im not using javascript validation [i.e my doesnt've
html:javascript formname=someform]
  how to do this?

  Subramaniam Olaganthan
  Tata Consultancy Services
  Mailto: [EMAIL PROTECTED]
  Website: http://www.tcs.com


RE: Validation doubt?

2004-02-24 Thread Vinay Kumar Munikuntla
Don't submit the form when user clicks on cancel button. This will avoid
calling validate method off the form bean.
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 24, 2004 11:21 AM
  To: [EMAIL PROTECTED]
  Subject: Validation doubt?



  Hi,
  I do not want to validate my form when the user clicks the Cancel
button.
  For your information im not using javascript validation [i.e my doesnt've
html:javascript formname=someform]
  how to do this?

  Subramaniam Olaganthan
  Tata Consultancy Services
  Mailto: [EMAIL PROTECTED]
  Website: http://www.tcs.com



-
This email, including any attachments, is for the designated recipient(s) only and may 
contain confidential, proprietary, and/or legally privileged information.  If you are 
not a designated recipient, or have received it in error, please notify the sender and 
destroy it and all attachments and copies immediately, without distributing, 
disclosing, or using it in any manner.

RE: Validation doubt?

2004-02-24 Thread subramaniam . o

Hi,
Thank you for the information.
on click of the cancel btn i want to
show the home page. how do i do that?

Subramaniam Olaganthan
Tata Consultancy Services
Plot No. 21
Industrial Estate,, Ambattur
Chennai - 600 058,Tamil Nadu
India
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com





Vinay Kumar Munikuntla
[EMAIL PROTECTED] 
02/24/2004 10:00 PM




Please respond to
Struts Users Mailing List [EMAIL PROTECTED]





To
'Struts Users Mailing List'
[EMAIL PROTECTED]


cc
[EMAIL PROTECTED]


Subject
RE: Validation doubt?








Don't submit the form when user clicks on cancel button.
This will avoid
calling validate method off the form bean.
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 24, 2004 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: Validation doubt?



 Hi,
 I do not want to validate my form when
the user clicks the Cancel
button.
 For your information im not using _javascript_ validation [i.e my
doesnt've
html:_javascript_ formname=someform]
 how to do this?

 Subramaniam Olaganthan
 Tata Consultancy Services
 Mailto: [EMAIL PROTECTED]
 Website: http://www.tcs.com



-
This email, including any attachments, is for the designated recipient(s)
only and may contain confidential, proprietary, and/or legally privileged
information. If you are not a designated recipient, or have received
it in error, please notify the sender and destroy it and all attachments
and copies immediately, without distributing, disclosing, or using it in
any manner.
ForwardSourceID:NT413E
 
DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the
addressee. Unauthorized use, disclosure or copying is strictly prohibited and may 
constitute unlawful act and can possibly attract legal action, civil and/or criminal. 
The contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services
on any subject matter. Any action taken or omitted to be taken based on this message 
is entirely at your risk and neither the originator of this message nor Tata 
Consultancy Services takes any responsibility or liability towards the same. Opinions, 
conclusions and any other
information contained in this message that do not relate to the official business of 
Tata Consultancy Services shall be understood as neither given nor endorsed by Tata 
Consultancy Services or any affiliate of Tata Consultancy Services. If you have 
received this message in error,
you should destroy this message and may please notify the sender by e-mail. Thank you.


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

RE: Validation doubt?

2004-02-24 Thread Angharad Stapleton
Either just use javascript to send to home page, or add a path in
struts-config to go to home page if cancel button was selected.
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: 24 February 2004 16:40
  To: Struts Users Mailing List
  Subject: RE: Validation doubt?



  Hi,
  Thank you for the information.
  on click of the cancel btn i want to show the home page. how do i do that?

  Subramaniam Olaganthan
  Tata Consultancy Services
  Plot No. 21
  Industrial Estate,, Ambattur
  Chennai - 600 058,Tamil Nadu
  India
  Mailto: [EMAIL PROTECTED]
  Website: http://www.tcs.com


Vinay Kumar Munikuntla [EMAIL PROTECTED]
02/24/2004 10:00 PM
  Please respond to
  Struts Users Mailing List [EMAIL PROTECTED]


   To 'Struts Users Mailing List' [EMAIL PROTECTED]
  cc [EMAIL PROTECTED]
  Subject RE: Validation doubt?







  Don't submit the form when user clicks on cancel button. This will
avoid
  calling validate method off the form bean.
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, February 24, 2004 11:21 AM
   To: [EMAIL PROTECTED]
   Subject: Validation doubt?



   Hi,
   I do not want to validate my form when the user clicks the Cancel
  button.
   For your information im not using javascript validation [i.e my doesnt've
  html:javascript formname=someform]
   how to do this?

   Subramaniam Olaganthan
   Tata Consultancy Services
   Mailto: [EMAIL PROTECTED]
   Website: http://www.tcs.com



  -
  This email, including any attachments, is for the designated recipient(s)
only and may contain confidential, proprietary, and/or legally privileged
information.  If you are not a designated recipient, or have received it in
error, please notify the sender and destroy it and all attachments and
copies immediately, without distributing, disclosing, or using it in any
manner.
  ForwardSourceID:NT413E


RE: Validation doubt?

2004-02-24 Thread subramaniam . o

Hi,
 Thanks for the information
but, all my forms extends ValidatorActionForm and Im Using Validation.xml
for
validating the form. how do i do that?
Please help me fix this one. Thanks
in advance.

Subramaniam Olaganthan
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com





Angharad Stapleton
[EMAIL PROTECTED] 
02/24/2004 09:57 PM




Please respond to
Struts Users Mailing List [EMAIL PROTECTED]





To
Struts Users Mailing
List [EMAIL PROTECTED]


cc



Subject
RE: Validation doubt?








Have the submit button has a form property. Then when
validating only valid
if submit button was hit.

e.g. if ((this.getSubmitButton() != null)  (!(
this.getSubmitButton().equals({
... validation code
}
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 24 February 2004 16:21
 To: [EMAIL PROTECTED]
 Subject: Validation doubt?



 Hi,
 I do not want to validate my form when
the user clicks the Cancel
button.
 For your information im not using _javascript_ validation [i.e my
doesnt've
html:_javascript_ formname=someform]
 how to do this?

 Subramaniam Olaganthan
 Tata Consultancy Services
 Mailto: [EMAIL PROTECTED]
 Website: http://www.tcs.com

ForwardSourceID:NT4132
 
DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the
addressee. Unauthorized use, disclosure or copying is strictly prohibited and may 
constitute unlawful act and can possibly attract legal action, civil and/or criminal. 
The contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services
on any subject matter. Any action taken or omitted to be taken based on this message 
is entirely at your risk and neither the originator of this message nor Tata 
Consultancy Services takes any responsibility or liability towards the same. Opinions, 
conclusions and any other
information contained in this message that do not relate to the official business of 
Tata Consultancy Services shall be understood as neither given nor endorsed by Tata 
Consultancy Services or any affiliate of Tata Consultancy Services. If you have 
received this message in error,
you should destroy this message and may please notify the sender by e-mail. Thank you.


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

RE: Validation doubt?

2004-02-24 Thread Vinay Kumar Munikuntla
Use link

html:link page=/homepage.do
. Cancel ..
/html:link
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 24, 2004 11:40 AM
  To: Struts Users Mailing List
  Subject: RE: Validation doubt?



  Hi,
  Thank you for the information.
  on click of the cancel btn i want to show the home page. how do i do that?

  Subramaniam Olaganthan
  Tata Consultancy Services
  Plot No. 21
  Industrial Estate,, Ambattur
  Chennai - 600 058,Tamil Nadu
  India
  Mailto: [EMAIL PROTECTED]
  Website: http://www.tcs.com


Vinay Kumar Munikuntla [EMAIL PROTECTED]
02/24/2004 10:00 PM
  Please respond to
  Struts Users Mailing List [EMAIL PROTECTED]


   To 'Struts Users Mailing List' [EMAIL PROTECTED]
  cc [EMAIL PROTECTED]
  Subject RE: Validation doubt?







  Don't submit the form when user clicks on cancel button. This will
avoid
  calling validate method off the form bean.
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, February 24, 2004 11:21 AM
   To: [EMAIL PROTECTED]
   Subject: Validation doubt?



   Hi,
   I do not want to validate my form when the user clicks the Cancel
  button.
   For your information im not using javascript validation [i.e my doesnt've
  html:javascript formname=someform]
   how to do this?

   Subramaniam Olaganthan
   Tata Consultancy Services
   Mailto: [EMAIL PROTECTED]
   Website: http://www.tcs.com



  -
  This email, including any attachments, is for the designated recipient(s)
only and may contain confidential, proprietary, and/or legally privileged
information.  If you are not a designated recipient, or have received it in
error, please notify the sender and destroy it and all attachments and
copies immediately, without distributing, disclosing, or using it in any
manner.
  ForwardSourceID:NT413E



-
This email, including any attachments, is for the designated recipient(s) only and may 
contain confidential, proprietary, and/or legally privileged information.  If you are 
not a designated recipient, or have received it in error, please notify the sender and 
destroy it and all attachments and copies immediately, without distributing, 
disclosing, or using it in any manner.

RE: Validation doubt?

2004-02-24 Thread subramaniam . o

Hi,
I tried that one, but i couldnt bypass
the validation..
i've an Update page, some of the attributes
are mandatory.
onlick of the cancel btn im forwarding
it to the home page, 
onclick of the cancel btn it validates
the form and gives error.
how do i bypass that one.

Note:-
Im using Images and not html:cancel


Subramaniam Olaganthan
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com





Angharad Stapleton
[EMAIL PROTECTED] 
02/24/2004 10:17 PM




Please respond to
Struts Users Mailing List [EMAIL PROTECTED]





To
Struts Users Mailing
List [EMAIL PROTECTED]


cc



Subject
RE: Validation doubt?








Either just use _javascript_ to send to home page, or
add a path in
struts-config to go to home page if cancel button was selected.
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 24 February 2004 16:40
 To: Struts Users Mailing List
 Subject: RE: Validation doubt?



 Hi,
 Thank you for the information.
 on click of the cancel btn i want to show the home page. how do
i do that?

 Subramaniam Olaganthan
 Tata Consultancy Services
 Plot No. 21
 Industrial Estate,, Ambattur
 Chennai - 600 058,Tamil Nadu
 India
 Mailto: [EMAIL PROTECTED]
 Website: http://www.tcs.com


Vinay Kumar Munikuntla [EMAIL PROTECTED]
02/24/2004 10:00 PM
   Please respond to
   Struts Users Mailing
List [EMAIL PROTECTED]


To 'Struts Users Mailing List' [EMAIL PROTECTED]
   cc [EMAIL PROTECTED]
   Subject RE: Validation
doubt?







 Don't submit the form when user clicks on cancel button. This
will
avoid
 calling validate method off the form bean.
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 24, 2004 11:21 AM
  To: [EMAIL PROTECTED]
  Subject: Validation doubt?



  Hi,
  I do not want to validate my form when
the user clicks the Cancel
 button.
  For your information im not using _javascript_ validation [i.e my
doesnt've
 html:_javascript_ formname=someform]
  how to do this?

  Subramaniam Olaganthan
  Tata Consultancy Services
  Mailto: [EMAIL PROTECTED]
  Website: http://www.tcs.com



 -
 This email, including any attachments, is for the designated recipient(s)
only and may contain confidential, proprietary, and/or legally privileged
information. If you are not a designated recipient, or have received
it in
error, please notify the sender and destroy it and all attachments and
copies immediately, without distributing, disclosing, or using it in any
manner.
 ForwardSourceID:NT413E

ForwardSourceID:NT4176
 
DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the
addressee. Unauthorized use, disclosure or copying is strictly prohibited and may 
constitute unlawful act and can possibly attract legal action, civil and/or criminal. 
The contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services
on any subject matter. Any action taken or omitted to be taken based on this message 
is entirely at your risk and neither the originator of this message nor Tata 
Consultancy Services takes any responsibility or liability towards the same. Opinions, 
conclusions and any other
information contained in this message that do not relate to the official business of 
Tata Consultancy Services shall be understood as neither given nor endorsed by Tata 
Consultancy Services or any affiliate of Tata Consultancy Services. If you have 
received this message in error,
you should destroy this message and may please notify the sender by e-mail. Thank you.


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

RE: Validation doubt?

2004-02-24 Thread Wendy Smoak
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 I tried that one, but i couldnt bypass the validation.. 
 i've an Update page, some of the attributes are mandatory. 
 onlick of the cancel btn im forwarding it to the home page, 
 onclick of the cancel btn it validates the form and gives error. 
 how do i bypass that one. 

I think this is the same sort of problem as, Why does my form get
validated the first time it is displayed?  You can either turn off
validation and call validate() manually when appropriate, or you can
override the validate method, and step around validation when it's not
necessary.  

I have validation turned on, but it only happens when the user clicks
'Finish':

   public ActionErrors validate( ActionMapping mapping,
  HttpServletRequest request )
   {
  /*
   *  only validate if the form has actually been POSTed.
   *  This keeps error messages from appearing when the
   *  form is displayed for the first time.
   */
  if ( request.getMethod().equals( POST ) ) {
 return super.validate( mapping, request );
  } else {
 return null;
  }
   }

You might look for the 'cancel' button in the request, and skip
validation in that case.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: Validation doubt?

2004-02-24 Thread Niall Pemberton
The question is when the user 'cancels' do you want to do anything before you forward 
to the home page. 

If you don't need to do any processing before forwarding to the home page then just 
have a html:link to the home page.

If you do ...

The html:cancel tag generates an input type=submit 
name=org.apache.struts.taglib.html.CANCEL value=... onclick=bCancel=true;/. The 
javascript validations are not performed if bCancel is true and the RequestProcessor 
skips validations if the request contains  'org.apache.struts.taglib.html.CANCEL'

As you are not using the  html:cancel tag, you need to do what it does so that 
validations are not done or put your own check in the forms validate() method so that 
if the user is cancelling then don't do the validation. I guess something along the 
lines of...

   html:image property=org.apache.struts.taglib.html.CANCEL onclick=bCancel=true; 
 .

Although I haven't tried it.


Niall

  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: Struts Users Mailing List 
  Sent: Tuesday, February 24, 2004 8:45 PM
  Subject: RE: Validation doubt?



  Hi, 
  I tried that one, but i couldnt bypass the validation.. 
  i've an Update page, some of the attributes are mandatory. 
  onlick of the cancel btn im forwarding it to the home page, 
  onclick of the cancel btn it validates the form and gives error. 
  how do i bypass that one. 

  Note:- 
  Im using Images and not html:cancel 

  Subramaniam Olaganthan
  Tata Consultancy Services
  Mailto: [EMAIL PROTECTED]
  Website: http://www.tcs.com 


Angharad Stapleton [EMAIL PROTECTED] 
02/24/2004 10:17 PM 
  Please respond to
  Struts Users Mailing List [EMAIL PROTECTED] 


   To Struts Users Mailing List [EMAIL PROTECTED]  
  cc  
  Subject RE: Validation doubt? 

  

   



  Either just use javascript to send to home page, or add a path in
  struts-config to go to home page if cancel button was selected.
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: 24 February 2004 16:40
   To: Struts Users Mailing List
   Subject: RE: Validation doubt?



   Hi,
   Thank you for the information.
   on click of the cancel btn i want to show the home page. how do i do that?

   Subramaniam Olaganthan
   Tata Consultancy Services
   Plot No. 21
   Industrial Estate,, Ambattur
   Chennai - 600 058,Tamil Nadu
   India
   Mailto: [EMAIL PROTECTED]
   Website: http://www.tcs.com


 Vinay Kumar Munikuntla [EMAIL PROTECTED]
 02/24/2004 10:00 PM
   Please respond to
   Struts Users Mailing List [EMAIL PROTECTED]


To 'Struts Users Mailing List' [EMAIL PROTECTED]
   cc [EMAIL PROTECTED]
   Subject RE: Validation doubt?







   Don't submit the form when user clicks on cancel button. This will
  avoid
   calling validate method off the form bean.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 24, 2004 11:21 AM
To: [EMAIL PROTECTED]
Subject: Validation doubt?



Hi,
I do not want to validate my form when the user clicks the Cancel
   button.
For your information im not using javascript validation [i.e my doesnt've
   html:javascript formname=someform]
how to do this?

Subramaniam Olaganthan
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com



   -
   This email, including any attachments, is for the designated recipient(s)
  only and may contain confidential, proprietary, and/or legally privileged
  information.  If you are not a designated recipient, or have received it in
  error, please notify the sender and destroy it and all attachments and
  copies immediately, without distributing, disclosing, or using it in any
  manner.
   ForwardSourceID:NT413E

  ForwardSourceID:NT4176 



--


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

Client Side Validation Question

2004-02-20 Thread Juan Carlos Paramá
 Hi,

 I have a little problem with validation. I have a form with a field
 html:text that show the property de a bean in a session scope. If the
 field is empty at the load of the page the validation works right, but if
 the property have any value at the load the validation (required) fail. I
 think that cause is the render of the html:text to:

 input value=some value

and the value is not null. If the form field is cleared in the screen is
 empty but code fail to validate.

Are there a workaround for this?

Thanks in advance.

-- 
Juan Carlos Paramá





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



Perform date validation only if field required (requiredIf/validWhen)

2004-02-20 Thread Ivan Jensen

Hi,

I have three radio buttons in a form,

---
o Today
o Tomorrow
o From this date: [  ] 
---

I am currently using requiredIf and date validation on the date textarea .  The date 
entry is only required if the correct radio button is selected and the date validation 
makes sure this is in the right format.  

This works fine, until the user enters an invalid date that doesn't pass date 
validation and *then* select's one of the other radio buttons, and submits.  The 
requiredIf passes fine (not required), but the date validation is still perfomed and 
returns the page to the user.

Is it possible to perform date validation only if requiredif decides the fields are 
required?  That is, don't test things that aren't required, without:
  * extra javascript in the page
  * without using custom validation java-code (the rest of the form's validation works 
great)

I have looked at validWhen (and am not aversed to going to the nightly-build), but 
can't see the solution there either.

Any help would be appreciated,

Ivan 
 


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

Question on Validation

2004-02-19 Thread Patrick Cheng
Hi all,
 I am trying to validate a collection of objects, like:
field property=meansAddress
indexedListProperty=value.notifications
   depends=mask,required
var
var-namemask/var-name
var-value^[0-9]*$/var-value
/var
arg0 key=Appointment.notificationInformation.label/
/field  

My question is.. I have 5 sets of 'meansAddress', but the error message
is NOT able to tell which one has error. As long as one or more have
errors, the SAME message will be shown.. Can anyone confirm, that's all
I can do? I can't get down to which one in the collection cuzes the
problem. Right?

Cheers,
Patrick.

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



Validation

2004-02-18 Thread Patrick Cheng
Hi all,
 
My question is... if my form has a collection of fields called storing
multiple email, dynamically added by javascript, how would i define it
in validation.xml in a general way, so that it can accomodate any number
of email addresses? 
That is,
i probably have hidden fields created as long as the user keeps adding
email addresses.
email[0] , email[1] 
is there a generic way in validation.xml to validate the whole list of
email items, with just one definition in validation.xml?
 
Thanks a lot.
 
Patrick.


Re: client-side validation not working

2004-02-15 Thread Niall Pemberton
James,

In your validation configuration file you have not set the date pattern
variable - there are two forms of it - datePattern and datePatternStrict.

 formset

   form name=ActivityViewForm
 field
property=starting
depends=date
   arg0 key=ActivityViewForm.starting.displayname/
   var
var-namedatePattern/var-name
var-valuedd/MM//var-value
/var
 /field
 field
property=ending
depends=date
   arg0 key=ActivityViewForm.ending.displayname/
   var
var-namedatePattern/var-name
var-valuedd/MM//var-value
/var
 /field
   /form

 /formset

Try that.

Niall

- Original Message - 
From: Anderson, James H [IT] [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Saturday, February 14, 2004 6:08 PM
Subject: RE: client-side validation not working


 Yes and yes.

 -Original Message-
 From: Saul Q Yuan [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 13, 2004 4:17 PM
 To: 'Struts Users Mailing List'
 Subject: RE: client-side validation not working


 So, did you find the validateDate function, and was it called?

 -Original Message-
 From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 13, 2004 3:29 PM
 To: Struts Users Mailing List
 Subject: RE: client-side validation not working


 Struts 1.1

 -Original Message-
 From: Saul Q Yuan [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 13, 2004 11:25 AM
 To: 'Struts Users Mailing List'
 Subject: RE: client-side validation not working


 Try to put some alerts in the validateDate javascript function in the
 validator-rules.xml file and see if the function is called. BTW, what
 version of Struts you are using?

 Saul

 -Original Message-
 From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 13, 2004 10:12 AM
 To: Struts Users Mailing List
 Subject: RE: client-side validation not working


 To test the possibility of it being a problem with using html:image
 instead of html:submit, I replaced html:image by html:submit but got the
 same result, i.e., the client-side validation is not being invoked.

 -Original Message-
 From: Niall Pemberton [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 13, 2004 9:42 AM
 To: Struts Users Mailing List
 Subject: Re: client-side validation not working


 Everything looks OK to me.

 Have you checked what javascript is being generated - use view source
 in your browser when you are looking at the page. is there a
 validateActivityViewForm() method and is that method doing the
 validations you expect?

 A second thought is how are you submitting your page - I had problems
 when I was using javascript with a link tag. If your doing that, then
 try putting an ordinary submit button on the page and see if that works.

 html:submitSave/html:submit

 Niall


 - Original Message - 
 From: Anderson, James H [IT] [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, February 13, 2004 2:23 PM
 Subject: client-side validation not working


 Server-side validation is working fine, but I can't seem to get
 client-side working.

 I know I must be doing something wrong, but I can't figure out what it
 is :-(

 Here's a bit of the tile that uses validation:

 %@ taglib uri=/tags/struts-bean prefix=bean %
 %@ taglib uri=/tags/struts-html prefix=html %
 %@ taglib uri=/tags/struts-logic prefix=logic %

 html:form action=/SelectActivity onsubmit=return
 validateActivityViewForm(this)
 TABLE border=0 cellspacing=0 cellpadding=0 align=center
 ...
   html:text property=starting value= size=10/ ...
   html:text property=ending value= size=10/
 ...
  logic:messagesPresent
 html:messages id=error
   TRTDFONT color=redSTRONGbean:write
 name=error//STRONG/FONTTDTR
 /html:messages
   /logic:messagesPresent
 /TABLE
 /html:form
 html:javascript formName=ActivityViewForm/

 Here's the piece of validation.xml:

 formset

   form name=ActivityViewForm
 field
property=starting
depends=date
   arg0 key=ActivityViewForm.starting.displayname/
 /field
 field
property=ending
depends=date
   arg0 key=ActivityViewForm.ending.displayname/
 /field
   /form

 /formset

 Here's the Action entry from struts-config:

 action
path=/SelectActivity
name=ActivityViewForm
type=portfolio.SelectActivityAction
input=.activity.detail/


 ActivityViewForm extends PortfolioForm which is declared thusly:

 public class PortfolioForm extends ValidatorForm implements Serializable
 {

 As I said, server-side validation is working fine, but the javascript on
 the client-side isn't getting activated.

 I hope someone can help me

  1   2   3   4   5   6   7   8   9   10   >