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.(SimpleDateFormat.java:443)
>   java.text.SimpleDateFormat.(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]



Re: Array of text fields generated dynamically - validation problem

2004-02-09 Thread Nafise Dianatizade
I have problem with array validation too, I can print the propety values in my action, 
but the validation doesn't work when I'm working with array type(ex. String[]). The 
validation of  "required" rule returns no error when it's empty.
 
Is there any special configuration for validating properties of type array?
 
Thank you
Nafise


-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: Array of text fields generated dynamically - validation problem

2004-02-08 Thread Shyam A
Hi,

I use a String[] in my form bean to handle a dynamic
array of text fields.

In my ActionForm, I have

private String[] candList;

public String[] getCandList()
{
return candList;
}

public void setCandList(String[] aCandList)
{
candList = aCandList;
}



In my JSP, I use

 

within a  tag.

My problem is that when a validation error occurs in
the validate() method of my form bean, the text fields
are populated with junk values. The text fields do not
retain the user entered values. However, the user
entered values can be printed out in the validate()
method.

How do I work around this problem?

Any help, suggestions/pointers will be greatly
appreciated.

Thanks,
Shyam



--- Shyam A <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a scenario in my Struts application, where I
> have an array of text fields grouped by category on
> a
> JSP, and these are generated dynamically.
> 
> eg.
> Category A
> text field 1
> text field 2
> text field 3
> 
> Category B
> text field 1
> text field 2
> 
> 
> 
> 
> The issue here is how to handle the values of the
> text
> fields in my form bean. What I plan to do is to have
> a
> String array for the text fields, and also a
> corresponding array of hidden fields, to identify
> the
> category.
> 
> Is this the best way to handle this situation?
> 
> Any help/suggustions/pointers will be greatly
> appreciated.
> 
> Thanks,
> Shyam
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing
> online.
> http://taxes.yahoo.com/filing.html
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: Validation problem

2004-02-03 Thread Jiin-Her Lu
This is an interesting thing. Here is the way to avoid Struts calls  validate method 
on ActionForm

This one Struts framework will NOT call validate method on ActionForm



While this one does 



The only difference is if you do have property, Struts adds name="your_data". While if 
you don't have property set, Struts add name="org.apache.struts.taglib.html.CANCEL". 

Why these make the difference?



Jiin-Her Lu
(816) 926-2145

>>> [EMAIL PROTECTED] 01/29/04 05:45PM >>>
The Struts Validator provides a mechanism to deal with Cancel buttons. A
flag is set in the onclick method for the cancel button in the jsp page. The
validate methods check this flag and if it is set, they skip validation and
just return true.
 


If you're not using the Struts Validator, maybe you could try mimicking this
behavior in your validate method ??

Brian Barnett

-Original Message-
From: Nathan Pitts [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 29, 2004 4:16 PM
To: Struts List
Subject: Validation problem

I am wondering how to solve the following problem with a minimal amount 
of recoding, and hope someone can give some input.  I have a form the 
has three html:submit buttons -- Update, Cancel and Delete.   I am 
using a LookupDispatchAction and an ActionForm with the validation in 
the validate() method.  Under normal conditions everything works 
fine..But when a user clicks Update with invalid data on the form, 
the validate method catches the bad data and returns the proper error 
message.  If the user then decides to click Cancel (without changing 
the invalid data), the validate() method is still called and the user 
is returned the same error.


One thing that I might be able to do is to somehow find out what button 
was clicked in the validate() method...??  How would I do that, I 
wonder...



thanks in advance,
-nathan


-
To unsubscribe, 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 problem

2004-01-29 Thread Barnett, Brian W.
The Struts Validator provides a mechanism to deal with Cancel buttons. A
flag is set in the onclick method for the cancel button in the jsp page. The
validate methods check this flag and if it is set, they skip validation and
just return true.
 


If you're not using the Struts Validator, maybe you could try mimicking this
behavior in your validate method ??

Brian Barnett

-Original Message-
From: Nathan Pitts [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 29, 2004 4:16 PM
To: Struts List
Subject: Validation problem

I am wondering how to solve the following problem with a minimal amount 
of recoding, and hope someone can give some input.  I have a form the 
has three html:submit buttons -- Update, Cancel and Delete.   I am 
using a LookupDispatchAction and an ActionForm with the validation in 
the validate() method.  Under normal conditions everything works 
fine..But when a user clicks Update with invalid data on the form, 
the validate method catches the bad data and returns the proper error 
message.  If the user then decides to click Cancel (without changing 
the invalid data), the validate() method is still called and the user 
is returned the same error.


One thing that I might be able to do is to somehow find out what button 
was clicked in the validate() method...??  How would I do that, I 
wonder...



thanks in advance,
-nathan


-
To unsubscribe, 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 problem

2004-01-29 Thread Robert Taylor
What's the name of your "Cancel" button? Struts should not validate
if it finds org.apache.struts.taglib.html.CANCEL or
org.apache.struts.taglib.html.CANCEL.x

Take a look at the RequestProcessor.processValidate() code:

 if (request.getAttribute(Globals.CANCEL_KEY) != null) {
if (log.isDebugEnabled()) {
log.debug(" Cancelled transaction, skipping validation");
}
return (true);
}

That attribute gets set in RequestProcessor.processPopulate():

 // Set the cancellation request attribute if appropriate
if ((request.getParameter(Constants.CANCEL_PROPERTY) != null) ||
(request.getParameter(Constants.CANCEL_PROPERTY_X) != null)) {
request.setAttribute(Globals.CANCEL_KEY, Boolean.TRUE);
}

robert

> -Original Message-
> From: Nathan Pitts [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 29, 2004 6:16 PM
> To: Struts List
> Subject: Validation problem
> 
> 
> I am wondering how to solve the following problem with a minimal amount 
> of recoding, and hope someone can give some input.  I have a form the 
> has three html:submit buttons -- Update, Cancel and Delete.   I am 
> using a LookupDispatchAction and an ActionForm with the validation in 
> the validate() method.  Under normal conditions everything works 
> fine..But when a user clicks Update with invalid data on the form, 
> the validate method catches the bad data and returns the proper error 
> message.  If the user then decides to click Cancel (without changing 
> the invalid data), the validate() method is still called and the user 
> is returned the same error.
> 
> 
> One thing that I might be able to do is to somehow find out what button 
> was clicked in the validate() method...??  How would I do that, I 
> wonder...
> 
> 
> 
> thanks in advance,
> -nathan
> 
> 
> -
> To unsubscribe, 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 problem

2004-01-29 Thread Nathan Pitts
I am wondering how to solve the following problem with a minimal amount 
of recoding, and hope someone can give some input.  I have a form the 
has three html:submit buttons -- Update, Cancel and Delete.   I am 
using a LookupDispatchAction and an ActionForm with the validation in 
the validate() method.  Under normal conditions everything works 
fine..But when a user clicks Update with invalid data on the form, 
the validate method catches the bad data and returns the proper error 
message.  If the user then decides to click Cancel (without changing 
the invalid data), the validate() method is still called and the user 
is returned the same error.

One thing that I might be able to do is to somehow find out what button 
was clicked in the validate() method...??  How would I do that, I 
wonder...



thanks in advance,
-nathan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: validation problem

2004-01-16 Thread Matthias Wessendorf
mmm strange :-)

in your action
the is a blank
name = "loginForm"


try name="loginForm"


okay you have DynaValidatorForm
not DynaValidatorActionForm
(it´s sometimes not clear (the differents)...)

and you have

  

and NOT! name="/login"
(what is needed for DynaValodatorActionForm...




so please try to create an own bean
which extends DynaValidatorForm
and in its validator()
do some debug-output
(for seeing, validator-framework works...)


greetings

-Original Message-
From: Kelly Goedert [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 12:08 PM
To: Struts Users Mailing List
Subject: Re: validation problem


I'm sorry, I didn't get what you mean... could you explain?

Matthias Wessendorf wrote:

>what is about
>
>name="loginForm"
>
>instead:
>name = "loginForm"
>(as action.-attribute)?
>
>but can´t be... ?!?
>
>
>
>-Original Message-
>From: Kelly Goedert [mailto:[EMAIL PROTECTED]
>Sent: Friday, January 16, 2004 11:41 AM
>To: Struts Users Mailing List
>Subject: Re: validation problem
>
>
>Yes I did. It is exactly like your application.
>
>Matthias Wessendorf wrote:
>
>  
>
>>hi kelly,
>>
>>did you integrate it into
>>struts-config?
>>
>>-->
>>
>>  >
>>
>className="org.apache.struts.validator.ValidatorPlugIn">
>  
>
>>  >  property="pathnames"
>>  
>>value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
>>  
>>
>>greetings
>>
>>-Original Message-
>>From: Kelly Goedert [mailto:[EMAIL PROTECTED]
>>Sent: Friday, January 16, 2004 11:25 AM
>>To: Struts Users Mailing List
>>Subject: validation problem
>>
>>
>>Hi,
>>
>>I'm trying to use the validator in a form that is used in as login 
>>form for authentication. And the fields are not being checked.
>>
>>I have this mapping on struts-config.xml
>>
>>
>>   
>>   >type="org.apache.struts.validator.DynaValidatorForm">
>>   
>>   
>>   
>>   
>>
>>   >   type="LoginAction"
>>   name = "loginForm"
>>   scope="request"
>>   input="/login.jsp"
>>   validate="true">
>>   >   name="continue"
>>   path="/pages/principal.jsp"/>
>>   >   name="erro"
>>   path="/login.jsp"/>
>>   
>>
>>In the validation.xml I have this:
>>
>>
>>   
>>   
>>   >   depends="required">
>>   
>>   
>>   >   depends="required">
>>   
>>   
>>   
>>  
>>
>>
>>Why the fields are not checked??
>>
>>
>>-
>>To unsubscribe, 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: validation problem

2004-01-16 Thread Eric C
Shouldn't your formbean type point to the actual class loginForm instead of
"org.apache.struts.validator.DynaValidatorForm", which i believe should be
in the bean code (bean extends DynaValidatorForm) ?


- Original Message -
From: "Kelly Goedert" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, January 16, 2004 11:24 AM
Subject: validation problem


> Hi,
>
> I'm trying to use the validator in a form that is used in as login form
> for authentication.
> And the fields are not being checked.
>
> I have this mapping on struts-config.xml
>
> 
> 
>  type="org.apache.struts.validator.DynaValidatorForm">
> 
> 
> 
> 
>
>  type="LoginAction"
> name = "loginForm"
> scope="request"
> input="/login.jsp"
> validate="true">
>  name="continue"
> path="/pages/principal.jsp"/>
>  name="erro"
> path="/login.jsp"/>
> 
>
> In the validation.xml I have this:
>
> 
> 
> 
>  depends="required">
> 
> 
>  depends="required">
> 
> 
> 
> 
> 
>
> Why the fields are not checked??
>
>
> -
> To unsubscribe, 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 problem

2004-01-16 Thread Kelly Goedert
I'm sorry, I didn't get what you mean... could you explain?

Matthias Wessendorf wrote:

what is about

name="loginForm"

instead:
name = "loginForm"
(as action.-attribute)?
but can´t be... ?!?



-Original Message-
From: Kelly Goedert [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 11:41 AM
To: Struts Users Mailing List
Subject: Re: validation problem

Yes I did. It is exactly like your application.

Matthias Wessendorf wrote:

 

hi kelly,

did you integrate it into
struts-config?
-->

	
   

className="org.apache.struts.validator.ValidatorPlugIn">
 



greetings

-Original Message-
From: Kelly Goedert [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 11:25 AM
To: Struts Users Mailing List
Subject: validation problem
Hi,

I'm trying to use the validator in a form that is used in as login form
for authentication.
And the fields are not being checked.
I have this mapping on struts-config.xml


  
  
  
  
  
  
  
  
  
  
In the validation.xml I have this:


  
  
  
  depends="required">
  
  
  
  depends="required">
  
  
  
 


Why the fields are not checked??

-
To unsubscribe, 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: validation problem

2004-01-16 Thread Matthias Wessendorf
what is about

name="loginForm"

instead:
name = "loginForm"
(as action.-attribute)?

but can´t be... ?!?



-Original Message-
From: Kelly Goedert [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 11:41 AM
To: Struts Users Mailing List
Subject: Re: validation problem


Yes I did. It is exactly like your application.

Matthias Wessendorf wrote:

>hi kelly,
>
>did you integrate it into
>struts-config?
>
>-->
>
>   
>  property="pathnames"
>   
>value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
>   
>
>greetings
>
>-Original Message-
>From: Kelly Goedert [mailto:[EMAIL PROTECTED]
>Sent: Friday, January 16, 2004 11:25 AM
>To: Struts Users Mailing List
>Subject: validation problem
>
>
>Hi,
>
>I'm trying to use the validator in a form that is used in as login form
>for authentication.
>And the fields are not being checked.
>
>I have this mapping on struts-config.xml
>
>
>
>type="org.apache.struts.validator.DynaValidatorForm">
>
>
>
>
>
>type="LoginAction"
>name = "loginForm"
>scope="request"
>input="/login.jsp"
>validate="true">
>name="continue"
>path="/pages/principal.jsp"/>
>name="erro"
>path="/login.jsp"/>
>
>
>In the validation.xml I have this:
>
>
>
>
>depends="required">
>
>
>depends="required">
>
>
>
>   
>
>
>Why the fields are not checked??
>
>
>-
>To unsubscribe, 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: validation problem

2004-01-16 Thread Kelly Goedert
Yes I did. It is exactly like your application.

Matthias Wessendorf wrote:

hi kelly,

did you integrate it into
struts-config?
-->




greetings

-Original Message-
From: Kelly Goedert [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 11:25 AM
To: Struts Users Mailing List
Subject: validation problem

Hi,

I'm trying to use the validator in a form that is used in as login form 
for authentication.
And the fields are not being checked.

I have this mapping on struts-config.xml


   
   
   
   
   
   

   
   
   
   
In the validation.xml I have this:


   
   
   
   depends="required">
   
   
   
   depends="required">
   
   
   
  


Why the fields are not checked??

-
To unsubscribe, 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 problem

2004-01-16 Thread Matthias Wessendorf
hi kelly,

did you integrate it into
struts-config?

-->





greetings

-Original Message-
From: Kelly Goedert [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 16, 2004 11:25 AM
To: Struts Users Mailing List
Subject: validation problem


Hi,

I'm trying to use the validator in a form that is used in as login form 
for authentication.
And the fields are not being checked.

I have this mapping on struts-config.xml














In the validation.xml I have this:











   


Why the fields are not checked??


-
To unsubscribe, 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 problem

2004-01-16 Thread Kelly Goedert
Hi,

I'm trying to use the validator in a form that is used in as login form 
for authentication.
And the fields are not being checked.

I have this mapping on struts-config.xml


   
   
   
   
   
   

   
   
   
   
In the validation.xml I have this:


   
   
   
   depends="required">
   
   
   
   depends="required">
   
   
   
  


Why the fields are not checked??

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


Re: Date validation problem?

2003-12-30 Thread Brice Ruth
OK, how do I enable server-side validation? I have validate="true" in my 
action-mapping definition, is that all I need?!

Andy Schmidgall wrote:

No, you should be able to do both. I was just saying that if you had
counted on datePattern functionality, and you switch to
datePatternStrict, you may get slightly different results as they are
supposed to act slightly differently. :)
-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 11:08 AM
To: Struts Users Mailing List
Subject: Re: Date validation problem?

How exactly do I get server-side validation? Is this an XOR condition? 
Either javascript or server-side, but not both?

Andy Schmidgall wrote:

 

The javascript should work, yes. I haven't tried this with serverside 
validation though. DatePattern works (or is supposed to work) 
differently than datePatternStrict, so be aware that if you were 
counting on datePattern functionality serverside, it may not work as 
you had expected.

-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 30, 2003 10:44 AM
To: Struts Users Mailing List
Subject: Re: Date validation problem?
Aha, so all I need to do is change "datePattern" to "datePatternStrict"
in my XML?
Andy Schmidgall wrote:



   

datePattern doesn't work -- you must use datePatternStrict unless you
modify the javascript validation function.
This line is where the pattern is loaded:

var datePattern = oDate[x][2]("datePatternStrict");

Notice that it's loading datePatternStrict instead of datePattern from
the oDate object. The validation function completely ignores the 
datePattern var you defined in the xml.

You're getting the error because it's trying to load from the
datePatternStrict var which isn't defined, so the javascript 
datePattern var isn't a valid object.

-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 30, 2003 9:55 AM
To: Struts Users Mailing List
Subject: Date validation problem?
I'm testing the JavaScript validation for my form and noticed that the
 

 

JavaScript generated to validate my date fields throws an error that I
 

 

can see in Firebird's JavaScript console. Here's the error:

datePattern has no properties

and here's the line it occurs on:

for (x in oDate) {

	var value = form[oDate[x][0]].value;

	var datePattern = oDate[x][2]("datePatternStrict");



  

 

	if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type
   

  

 

==

  

 

'textarea') && value.length > 0 && datePattern.length > 0) {
   

  

 

		var MONTH = "MM";

		var DAY = "dd";

		var YEAR = "";

I can see that my date fields appear correctly in DateValidations(),
here:
 function DateValidations () {

  this.aa = new Array("theStartDate", "Availability Start Date is
not a valid date.", new Function ("varName", 
"this.datePattern='MM/dd/yy'; return this[varName];"));

  this.ab = new Array("theEndDate", "Availability End Date is not a
valid date.", new Function ("varName", "this.datePattern='MM/dd/yy'; 
return this[varName];"));

 }

And in my validation.xml file, the following is defined:



	

	

		datePattern

		${defaultDate}

	





	

	

		datePattern

		${defaultDate}

	



Where ${defaultDate} is a global defined as:



	defaultDate

	MM/dd/yy



 

From what I can see in DateValidations(), it looks like the var-value 
   

is being picked up correctly ... so, I'm at a bit of a loss on this. 
Is
  

 



   

this a know bug in Struts 1.1?

Also, does using DynaValidatorForm with validation.xml and such *only*
 

 

do JavaScript validation or is server-side validation performed as
  

 

well?

   

It'd be a nice bonus to have server-side validation, to prevent 
corrupt or malicious submittals, but that may require a custom 
ActionForm?!

  

 



   

 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Date validation problem?

2003-12-30 Thread Andy Schmidgall
No, you should be able to do both. I was just saying that if you had
counted on datePattern functionality, and you switch to
datePatternStrict, you may get slightly different results as they are
supposed to act slightly differently. :)

-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 11:08 AM
To: Struts Users Mailing List
Subject: Re: Date validation problem?


How exactly do I get server-side validation? Is this an XOR condition? 
Either javascript or server-side, but not both?

Andy Schmidgall wrote:

>The javascript should work, yes. I haven't tried this with serverside 
>validation though. DatePattern works (or is supposed to work) 
>differently than datePatternStrict, so be aware that if you were 
>counting on datePattern functionality serverside, it may not work as 
>you had expected.
>
>-Andy
>
>-Original Message-
>From: Brice Ruth [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, December 30, 2003 10:44 AM
>To: Struts Users Mailing List
>Subject: Re: Date validation problem?
>
>
>Aha, so all I need to do is change "datePattern" to "datePatternStrict"
>in my XML?
>
>Andy Schmidgall wrote:
>
>  
>
>>datePattern doesn't work -- you must use datePatternStrict unless you
>>modify the javascript validation function.
>>
>>This line is where the pattern is loaded:
>>
>>var datePattern = oDate[x][2]("datePatternStrict");
>>
>>Notice that it's loading datePatternStrict instead of datePattern from
>>the oDate object. The validation function completely ignores the 
>>datePattern var you defined in the xml.
>>
>>You're getting the error because it's trying to load from the
>>datePatternStrict var which isn't defined, so the javascript 
>>datePattern var isn't a valid object.
>>
>>-Andy
>>
>>-Original Message-
>>From: Brice Ruth [mailto:[EMAIL PROTECTED]
>>Sent: Tuesday, December 30, 2003 9:55 AM
>>To: Struts Users Mailing List
>>Subject: Date validation problem?
>>
>>
>>I'm testing the JavaScript validation for my form and noticed that the

>>JavaScript generated to validate my date fields throws an error that I

>>can see in Firebird's JavaScript console. Here's the error:
>>
>>datePattern has no properties
>>
>>and here's the line it occurs on:
>>
>>for (x in oDate) {
>>
>>  var value = form[oDate[x][0]].value;
>>
>>  var datePattern = oDate[x][2]("datePatternStrict");
>>
>> 
>>
>>
>>
>>>>if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type
>>>> 
>>>>
>>>>
>>>>
>>==
>> 
>>
>>
>>
>>>>'textarea') && value.length > 0 && datePattern.length > 0) {
>>>> 
>>>>
>>>>
>>>>
>>  var MONTH = "MM";
>>
>>  var DAY = "dd";
>>
>>  var YEAR = "";
>>
>>
>>I can see that my date fields appear correctly in DateValidations(),
>>here:
>>
>>   function DateValidations () {
>>
>>this.aa = new Array("theStartDate", "Availability Start Date is
>>not a valid date.", new Function ("varName", 
>>"this.datePattern='MM/dd/yy'; return this[varName];"));
>>
>>this.ab = new Array("theEndDate", "Availability End Date is not a
>>valid date.", new Function ("varName", "this.datePattern='MM/dd/yy'; 
>>return this[varName];"));
>>
>>   }
>>
>>
>>And in my validation.xml file, the following is defined:
>>
>>
>>
>>  
>>
>>  
>>
>>  datePattern
>>
>>  ${defaultDate}
>>
>>  
>>
>>
>>
>>
>>
>>  
>>
>>  
>>
>>  datePattern
>>
>>  ${defaultDate}
>>
>>  
>>
>>
>>
>>
>>Where ${defaultDate} is a global defined as:
>>
>>
>>
>>  defaultDate
>>
>>  MM/dd/yy
>>
>>
>>
>>
>>From what I can see in DateValidations(), it looks like the var-value 
>>is being picked up correctly ... so, I'm at a bit of a loss on this. 
>>Is
>>
>>
>
>  
>
>>this a know bug in Struts 1.1?
>>
>>Also, does using DynaValidatorForm with validation.xml and such *only*

>>do JavaScript validation or is server-side validation performed as
>>
>>
>well?
>  
>
>>It'd be a nice bonus to have server-side validation, to prevent 
>>corrupt or malicious submittals, but that may require a custom 
>>ActionForm?!
>> 
>>
>>
>>
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


-
To unsubscribe, 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: Date validation problem?

2003-12-30 Thread Brice Ruth
How exactly do I get server-side validation? Is this an XOR condition? 
Either javascript or server-side, but not both?

Andy Schmidgall wrote:

The javascript should work, yes. I haven't tried this with serverside
validation though. DatePattern works (or is supposed to work)
differently than datePatternStrict, so be aware that if you were
counting on datePattern functionality serverside, it may not work as you
had expected.
-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 10:44 AM
To: Struts Users Mailing List
Subject: Re: Date validation problem?

Aha, so all I need to do is change "datePattern" to "datePatternStrict" 
in my XML?

Andy Schmidgall wrote:

 

datePattern doesn't work -- you must use datePatternStrict unless you 
modify the javascript validation function.

This line is where the pattern is loaded:

var datePattern = oDate[x][2]("datePatternStrict");

Notice that it's loading datePatternStrict instead of datePattern from 
the oDate object. The validation function completely ignores the 
datePattern var you defined in the xml.

You're getting the error because it's trying to load from the 
datePatternStrict var which isn't defined, so the javascript 
datePattern var isn't a valid object.

-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 30, 2003 9:55 AM
To: Struts Users Mailing List
Subject: Date validation problem?
I'm testing the JavaScript validation for my form and noticed that the
JavaScript generated to validate my date fields throws an error that I 
can see in Firebird's JavaScript console. Here's the error:

datePattern has no properties

and here's the line it occurs on:

for (x in oDate) {

	var value = form[oDate[x][0]].value;

	var datePattern = oDate[x][2]("datePatternStrict");



   

	if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type


   

==

   

'textarea') && value.length > 0 && datePattern.length > 0) {


   

		var MONTH = "MM";

		var DAY = "dd";

		var YEAR = "";

I can see that my date fields appear correctly in DateValidations(),
here:
  function DateValidations () {

   this.aa = new Array("theStartDate", "Availability Start Date is 
not a valid date.", new Function ("varName", 
"this.datePattern='MM/dd/yy'; return this[varName];"));

   this.ab = new Array("theEndDate", "Availability End Date is not a 
valid date.", new Function ("varName", "this.datePattern='MM/dd/yy'; 
return this[varName];"));

  }

And in my validation.xml file, the following is defined:



	

	

		datePattern

		${defaultDate}

	





	

	

		datePattern

		${defaultDate}

	



Where ${defaultDate} is a global defined as:



	defaultDate

	MM/dd/yy



From what I can see in DateValidations(), it looks like the var-value
is being picked up correctly ... so, I'm at a bit of a loss on this. Is
   

 

this a know bug in Struts 1.1?

Also, does using DynaValidatorForm with validation.xml and such *only*
do JavaScript validation or is server-side validation performed as
   

well?
 

It'd be a nice bonus to have server-side validation, to prevent corrupt
or malicious submittals, but that may require a custom ActionForm?!
   

 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Date validation problem?

2003-12-30 Thread Andy Schmidgall
The javascript should work, yes. I haven't tried this with serverside
validation though. DatePattern works (or is supposed to work)
differently than datePatternStrict, so be aware that if you were
counting on datePattern functionality serverside, it may not work as you
had expected.

-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 10:44 AM
To: Struts Users Mailing List
Subject: Re: Date validation problem?


Aha, so all I need to do is change "datePattern" to "datePatternStrict" 
in my XML?

Andy Schmidgall wrote:

>datePattern doesn't work -- you must use datePatternStrict unless you 
>modify the javascript validation function.
>
>This line is where the pattern is loaded:
>
>var datePattern = oDate[x][2]("datePatternStrict");
>
>Notice that it's loading datePatternStrict instead of datePattern from 
>the oDate object. The validation function completely ignores the 
>datePattern var you defined in the xml.
>
>You're getting the error because it's trying to load from the 
>datePatternStrict var which isn't defined, so the javascript 
>datePattern var isn't a valid object.
>
>-Andy
>
>-Original Message-
>From: Brice Ruth [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, December 30, 2003 9:55 AM
>To: Struts Users Mailing List
>Subject: Date validation problem?
>
>
>I'm testing the JavaScript validation for my form and noticed that the
>JavaScript generated to validate my date fields throws an error that I 
>can see in Firebird's JavaScript console. Here's the error:
>
>datePattern has no properties
>
>and here's the line it occurs on:
>
>for (x in oDate) {
>
>   var value = form[oDate[x][0]].value;
>
>   var datePattern = oDate[x][2]("datePatternStrict");
>
>  
>
>>> if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type
>>>  
>>>
>==
>  
>
>>>'textarea') && value.length > 0 && datePattern.length > 0) {
>>>  
>>>
>
>   var MONTH = "MM";
>
>   var DAY = "dd";
>
>   var YEAR = "";
>
>
>I can see that my date fields appear correctly in DateValidations(),
>here:
>
>function DateValidations () {
>
> this.aa = new Array("theStartDate", "Availability Start Date is 
>not a valid date.", new Function ("varName", 
>"this.datePattern='MM/dd/yy'; return this[varName];"));
>
> this.ab = new Array("theEndDate", "Availability End Date is not a 
>valid date.", new Function ("varName", "this.datePattern='MM/dd/yy'; 
>return this[varName];"));
>
>}
>
>
>And in my validation.xml file, the following is defined:
>
>
>
>   
>
>   
>
>   datePattern
>
>   ${defaultDate}
>
>   
>
>
>
>
>
>   
>
>   
>
>   datePattern
>
>   ${defaultDate}
>
>   
>
>
>
>
>Where ${defaultDate} is a global defined as:
>
>
>
>   defaultDate
>
>   MM/dd/yy
>
>
>
>
> From what I can see in DateValidations(), it looks like the var-value
>is being picked up correctly ... so, I'm at a bit of a loss on this. Is

>this a know bug in Struts 1.1?
>
>Also, does using DynaValidatorForm with validation.xml and such *only*
>do JavaScript validation or is server-side validation performed as
well?
>
>It'd be a nice bonus to have server-side validation, to prevent corrupt
>or malicious submittals, but that may require a custom ActionForm?!
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


-
To unsubscribe, 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: Date validation problem?

2003-12-30 Thread Brice Ruth
Aha, so all I need to do is change "datePattern" to "datePatternStrict" 
in my XML?

Andy Schmidgall wrote:

datePattern doesn't work -- you must use datePatternStrict unless you
modify the javascript validation function.
This line is where the pattern is loaded:

var datePattern = oDate[x][2]("datePatternStrict");

Notice that it's loading datePatternStrict instead of datePattern from
the oDate object. The validation function completely ignores the
datePattern var you defined in the xml.
You're getting the error because it's trying to load from the
datePatternStrict var which isn't defined, so the javascript datePattern
var isn't a valid object.
-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 9:55 AM
To: Struts Users Mailing List
Subject: Date validation problem?

I'm testing the JavaScript validation for my form and noticed that the 
JavaScript generated to validate my date fields throws an error that I 
can see in Firebird's JavaScript console. Here's the error:

datePattern has no properties

and here's the line it occurs on:

for (x in oDate) { 

	var value = form[oDate[x][0]].value;

	var datePattern = oDate[x][2]("datePatternStrict");

 

	if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type
 

== 
 

'textarea') && value.length > 0 && datePattern.length > 0) {
 

		var MONTH = "MM";

		var DAY = "dd";

		var YEAR = "";

I can see that my date fields appear correctly in DateValidations(),
here:
   function DateValidations () { 

this.aa = new Array("theStartDate", "Availability Start Date is not
a valid date.", new Function ("varName", "this.datePattern='MM/dd/yy';
return this[varName];"));
this.ab = new Array("theEndDate", "Availability End Date is not a
valid date.", new Function ("varName", "this.datePattern='MM/dd/yy';
return this[varName];"));
   } 

And in my validation.xml file, the following is defined:



	

	

		datePattern

		${defaultDate}

	





	

	

		datePattern

		${defaultDate}

	



Where ${defaultDate} is a global defined as:



	defaultDate

	MM/dd/yy



From what I can see in DateValidations(), it looks like the var-value 
is being picked up correctly ... so, I'm at a bit of a loss on this. Is 
this a know bug in Struts 1.1?

Also, does using DynaValidatorForm with validation.xml and such *only* 
do JavaScript validation or is server-side validation performed as well?

It'd be a nice bonus to have server-side validation, to prevent corrupt 
or malicious submittals, but that may require a custom ActionForm?!
 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Date validation problem?

2003-12-30 Thread Andy Schmidgall
datePattern doesn't work -- you must use datePatternStrict unless you
modify the javascript validation function.

This line is where the pattern is loaded:

var datePattern = oDate[x][2]("datePatternStrict");

Notice that it's loading datePatternStrict instead of datePattern from
the oDate object. The validation function completely ignores the
datePattern var you defined in the xml.

You're getting the error because it's trying to load from the
datePatternStrict var which isn't defined, so the javascript datePattern
var isn't a valid object.

-Andy

-Original Message-
From: Brice Ruth [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 9:55 AM
To: Struts Users Mailing List
Subject: Date validation problem?


I'm testing the JavaScript validation for my form and noticed that the 
JavaScript generated to validate my date fields throws an error that I 
can see in Firebird's JavaScript console. Here's the error:

datePattern has no properties

and here's the line it occurs on:

for (x in oDate) { 

var value = form[oDate[x][0]].value;

var datePattern = oDate[x][2]("datePatternStrict");

>>  if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type
== 
>>'textarea') && value.length > 0 && datePattern.length > 0) {

var MONTH = "MM";

var DAY = "dd";

var YEAR = "";


I can see that my date fields appear correctly in DateValidations(),
here:

function DateValidations () { 

 this.aa = new Array("theStartDate", "Availability Start Date is not
a valid date.", new Function ("varName", "this.datePattern='MM/dd/yy';
return this[varName];"));

 this.ab = new Array("theEndDate", "Availability End Date is not a
valid date.", new Function ("varName", "this.datePattern='MM/dd/yy';
return this[varName];"));

} 


And in my validation.xml file, the following is defined:







datePattern

${defaultDate}











datePattern

${defaultDate}






Where ${defaultDate} is a global defined as:



defaultDate

MM/dd/yy




 From what I can see in DateValidations(), it looks like the var-value 
is being picked up correctly ... so, I'm at a bit of a loss on this. Is 
this a know bug in Struts 1.1?

Also, does using DynaValidatorForm with validation.xml and such *only* 
do JavaScript validation or is server-side validation performed as well?

It'd be a nice bonus to have server-side validation, to prevent corrupt 
or malicious submittals, but that may require a custom ActionForm?!
-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.

-
To unsubscribe, 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?

2003-12-30 Thread Brice Ruth
I'm testing the JavaScript validation for my form and noticed that the 
JavaScript generated to validate my date fields throws an error that I 
can see in Firebird's JavaScript console. Here's the error:

datePattern has no properties

and here's the line it occurs on:

for (x in oDate) { 

	var value = form[oDate[x][0]].value;

	var datePattern = oDate[x][2]("datePatternStrict");

	if ((form[oDate[x][0]].type == 'text' || form[oDate[x][0]].type == 'textarea') && value.length > 0 && datePattern.length > 0) {
		var MONTH = "MM";

		var DAY = "dd";

		var YEAR = "";

I can see that my date fields appear correctly in DateValidations(), here:

   function DateValidations () { 

this.aa = new Array("theStartDate", "Availability Start Date is not a valid date.", new Function ("varName", "this.datePattern='MM/dd/yy';  return this[varName];"));

this.ab = new Array("theEndDate", "Availability End Date is not a valid date.", new Function ("varName", "this.datePattern='MM/dd/yy';  return this[varName];"));

   } 

And in my validation.xml file, the following is defined:



	

	

		datePattern

		${defaultDate}

	





	

	

		datePattern

		${defaultDate}

	



Where ${defaultDate} is a global defined as:



	defaultDate

	MM/dd/yy



From what I can see in DateValidations(), it looks like the var-value 
is being picked up correctly ... so, I'm at a bit of a loss on this. Is 
this a know bug in Struts 1.1?

Also, does using DynaValidatorForm with validation.xml and such *only* 
do JavaScript validation or is server-side validation performed as well? 
It'd be a nice bonus to have server-side validation, to prevent corrupt 
or malicious submittals, but that may require a custom ActionForm?!
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.

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


Re: Validation: Problem with datePattern and JavaScript

2003-12-11 Thread Rouven Gehm
Well yes this quick fix work, i have added the following :

var datePattern = oDate[x][2]("datePatternStrict");
if(datePattern == null) {

datePattern = oDate[x][2]("datePattern");

}

But the main problem is, the javascript code, afterwards still needs a

strict input (e.g. 01.06.2000)  and not checks if a not so strict

pattern (e.g. 1.6.2000) is a valid date.

So either someone already has coded the javascript, or else i'll do it


Thanx

Rouven


From: "Andy Schmidgall" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2003 7:15 PM
Subject: RE: Validation: Problem with datePattern and JavaScript


It looks like the following line of code (in the date validator rule in
validator-rules.xml) loads the pattern:

var datePattern = oDate[x][2]("datePatternStrict");

As far as I can tell, nothing is ever loaded for plain "datePattern",
and this matches up with my experiences of using datePattern (i.e.
"datePattern" doesn't do any validation at all)

I haven't tried this, but it should probably be an easy fix to check if
oDate[x][2]("datePattern") has a value and load that into datePattern.

-Andy


-Original Message-
From: Zakaria khabot [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 10, 2002 12:00 PM
To: Struts Users Mailing List
Subject: Re: Validation: Problem with datePattern and JavaScript


Hi,
Do u have an example of using validate-rules.xml in a JSP file.
Thanks

- Original Message - 
From: "Rouven Gehm" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 1:53 PM
Subject: Validation: Problem with datePattern and JavaScript


> I want to know if someone has updated the javascript code
> in the validate-rules.xml, for the datePattern option ? Because the 
> code i have from the Struts 1.1 zip only work with datePatternStrict 
> !!!
> 
> I have searched the user mailing list, for this problem, but not found

> any solution.
> 
> Thanx
> 
> Rouven
> 
> -
> To unsubscribe, 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: Validation: Problem with datePattern and JavaScript

2003-12-10 Thread Andy Schmidgall
It looks like the following line of code (in the date validator rule in
validator-rules.xml) loads the pattern:

var datePattern = oDate[x][2]("datePatternStrict");

As far as I can tell, nothing is ever loaded for plain "datePattern",
and this matches up with my experiences of using datePattern (i.e.
"datePattern" doesn't do any validation at all)

I haven't tried this, but it should probably be an easy fix to check if
oDate[x][2]("datePattern") has a value and load that into datePattern.

-Andy


-Original Message-
From: Zakaria khabot [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 10, 2002 12:00 PM
To: Struts Users Mailing List
Subject: Re: Validation: Problem with datePattern and JavaScript


Hi,
Do u have an example of using validate-rules.xml in a JSP file.
Thanks

- Original Message - 
From: "Rouven Gehm" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 1:53 PM
Subject: Validation: Problem with datePattern and JavaScript


> I want to know if someone has updated the javascript code
> in the validate-rules.xml, for the datePattern option ? Because the 
> code i have from the Struts 1.1 zip only work with datePatternStrict 
> !!!
> 
> I have searched the user mailing list, for this problem, but not found

> any solution.
> 
> Thanx
> 
> Rouven
> 
> -
> To unsubscribe, 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: Problem with datePattern and JavaScript

2003-12-10 Thread Zakaria khabot
Hi,
Do u have an example of using validate-rules.xml in a JSP file.
Thanks

- Original Message - 
From: "Rouven Gehm" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 1:53 PM
Subject: Validation: Problem with datePattern and JavaScript


> I want to know if someone has updated the javascript code
> in the validate-rules.xml, for the datePattern option ?
> Because the code i have from the Struts 1.1 zip only
> work with datePatternStrict !!!
> 
> I have searched the user mailing list, for this problem, but
> not found any solution.
> 
> Thanx
> 
> Rouven
> 
> -
> To unsubscribe, 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: Problem with datePattern and JavaScript

2003-12-04 Thread Rouven Gehm
I want to know if someone has updated the javascript code
in the validate-rules.xml, for the datePattern option ?
Because the code i have from the Struts 1.1 zip only
work with datePatternStrict !!!

I have searched the user mailing list, for this problem, but
not found any solution.

Thanx

Rouven

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



Re: preload validation problem

2003-11-19 Thread Rick Reumann
Nathan Maves wrote:

I have an action that loads a collection into the request so that the 
for can get pre-loaded.  The created form need to be validated.  When 
the validator runs the request is sent back to the original form.  
Problem is that the data need to pre-load the form is gone from the 
request.  How can I accomplish this task?
It depends.. is the collection actually populated into the form? If so 
it should remain in the form when the validation is returned. My guess 
is you are talking about a collection that you put into request scope. 
In that case it's easiest just to put the collection into session scope. 
There are other ways around it, but session scope is the easiest. (If 
everyone using the app will need the same collection use application scope).

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


preload validation problem

2003-11-17 Thread Nathan Maves
I have an action that loads a collection into the request so that the 
for can get pre-loaded.  The created form need to be validated.  When 
the validator runs the request is sent back to the original form.  
Problem is that the data need to pre-load the form is gone from the 
request.  How can I accomplish this task?

Nathan

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


Re: struts 1.1 validation problem / question

2003-11-16 Thread Phil
Hi Andreas,

i think the best way is to write your own
validate() method in your action form. There you
can easily check the value of the userAction attribute
and depending on that the other attributes.

example:

public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
  ActionErrors errors = new ActionErrors();

  if (getName().length() < 1) {
   errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("form.error.name.required"));
  }

  return errors;
 }

HTH

Phil

- Original Message -
From: "Andreas Wuest" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 15, 2003 2:36 PM
Subject: struts 1.1 validation problem / question


> Hi,
>
> i have a small problem / question concerning the struts 1.1 validation.
> i have a jsp form that has the following input fields :
>
> id
> name
> password
> userAction
>
> Depending on the userAction value (can be 'show' or 'save') i need to
> validate only the id (when userAction is 'show') or the name, password
> and id (when the userAction is 'save').
> i have one form that contains the 4 properties (with getters and setters)
> and an action class that handles the show and the save action.
>
> the problem that i have is the validation. as far as i understand the
> docuemtneation it is not possible to validate a property only when
> another property has a certain value. in other words it is not possible
> to tell the validator to skip validation of a property when another
property
> has a certain value.
> or am i mistaken ?
>
> how can i solve this problem ? do i need 2 forms and action to handle the
> different userActions or is there another way ??
>
> Thanks in advance,
>
>  Andreas
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: struts 1.1 validation problem / question

2003-11-16 Thread Andreas Wuest
Hi Victor,

thanks for you reply.  the lookupdispatchaction does not really solve
my problem, since handling the different actions is not the problem.
the problems is the validation of the input fields for the different 
action. i need different validations depending on the value of the
userAction html form value.

thanks, 

 Andreas

On Sunday 16 November 2003 10:51, Victor wrote:
> Oi Andre,
>
> Tries to verify the LookupDispatchAction class, this
> class allows to manage diverse actions in simple
> Action and in this way you can better manage its
> validations with the Validator.
>
> Good code.
> Victor Amano Izawa
>
> __
>
> Yahoo! Mail: 6MB, anti-spam e antivírus gratuito! Crie sua conta agora:
> http://mail.yahoo.com.br
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: struts 1.1 validation problem / question

2003-11-16 Thread Victor
Oi Andre, 

Tries to verify the LookupDispatchAction class, this
class allows to manage diverse actions in simple
Action and in this way you can better manage its
validations with the Validator.

Good code.
Victor Amano Izawa

__

Yahoo! Mail: 6MB, anti-spam e antivírus gratuito! Crie sua conta agora:
http://mail.yahoo.com.br

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



struts 1.1 validation problem / question

2003-11-15 Thread Andreas Wuest
Hi,

i have a small problem / question concerning the struts 1.1 validation.
i have a jsp form that has the following input fields : 

id
name
password
userAction

Depending on the userAction value (can be 'show' or 'save') i need to 
validate only the id (when userAction is 'show') or the name, password
and id (when the userAction is 'save').
i have one form that contains the 4 properties (with getters and setters)
and an action class that handles the show and the save action. 

the problem that i have is the validation. as far as i understand the 
docuemtneation it is not possible to validate a property only when
another property has a certain value. in other words it is not possible
to tell the validator to skip validation of a property when another property
has a certain value. 
or am i mistaken ?

how can i solve this problem ? do i need 2 forms and action to handle the
different userActions or is there another way ??

Thanks in advance,

 Andreas 


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



RE: Upgrading to 1.1 final validation problem...

2003-09-27 Thread João Luz
Sorry for the typo "But now when the page is not".  I wanted to say : "But
when the page parameter is not present in request it sends..."
Thanks

-Original Message-
From: João Luz [mailto:[EMAIL PROTECTED]
Sent: domingo, 28 de Setembro de 2003 3:58
To: [EMAIL PROTECTED]
Subject: Upgrading to 1.1 final validation problem...


Hi,

I'm doing upgrade from 1.1 beta to 1.1 final and I found some problems with
validation.

In 1.1 final is not required to call explicitly validate when using
DynaValidatorActionForm. This is great.

But now when the page is not it sends a NullPointerException executing , and
not uses the initial value specified in struts-config.

java.lang.NullPointerException
at
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.jav
a:141)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
ava:942)

Any clue or this is supposed to happen?

Thanks,
João



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


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



Upgrading to 1.1 final validation problem...

2003-09-27 Thread João Luz
Hi,

I'm doing upgrade from 1.1 beta to 1.1 final and I found some problems with
validation.

In 1.1 final is not required to call explicitly validate when using
DynaValidatorActionForm. This is great.

But now when the page is not it sends a NullPointerException executing , and
not uses the initial value specified in struts-config.

java.lang.NullPointerException
at
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.jav
a:141)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
ava:942)

Any clue or this is supposed to happen?

Thanks,
João



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



RE: multi-form page validation problem (client side)

2003-09-04 Thread Sieber Martin
Maybe I didn't make myself clear. This is not about the static code, but
about the dynamic code. If you read my original posting, than you will
see that I have put the static JavaScript already to false:

However my mail prog removed the line brakes and therefore this wasn't
readable well. Apologies for that.

My problem is, that all the dynamic functions overwrite each other: 
mask(), maxlength(), ... are dynamic parts of the JavaScript, since the
ApplicationProperty labels are generated in there e.g.:
function maxlength () {
 this.aa = new Array("businessName", "BusinessName shouldn't be
longer than 50 characters.", new Function ("varName",
"this.maxlength='50';  return this[varName];"));
 this.ab = new Array("surname", "Other Text", new Function
("varName", "this.maxlength='50';  return this[varName];"));
}

Cheers,
Martin

-Original Message-
From: Thomas Cornet [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 04, 2003 17:35
To: Struts Users Mailing List
Subject: Re: multi-form page validation problem (client side)



The html:javascript tag has a parameter named 'statisJavascript' which
says 
if Struts has to render all static code (i.e. the validations
functions). 
So, if you have several form in a page, you should write something like
this :



 ...

Thus, validation functions will appear only once.

HTH

Thomas

At 17:23 04/09/2003, you wrote:
>Hi,
>
>I'm having problems when validating a multiform page.
>I have 4 forms on a single page and I've set up the validation 
>framework for them. When I insert the html:javascript tag on the jsp 
>page to create the dynamic code, it creates sth like this:
>
>
> function validateFrm_ccd_crn_Filter(form) {  [...]   }
> function maxlength () {  this.aa = [...]   }
>
>
> function validateFrm_ccd_par_Filter(form) {  [...]   }
> function maxlength () {  this.aa = }
> function mask () {  [...]}
>
>
> function validateFrm_ccd_pol_Filter(form) {[...]   }
> function maxlength () {  this.aa = [...]}
> function mask () {  this.aa = [...]}
>
>
>The problem is, that the mask and maxlength methods overwrite each 
>other. Therefore the client side validation does work only for the last

>form that is used on the page. Anything that I should different than 
>including: dynamicJavascript="true" /> dynamicJavascript="true" />
>dynamicJavascript="true" /> dynamicJavascript="true" /> on the JSP
page? 
>The server side validation works fine btw. Any help highly appreciated.

>Cheers, Martin 
>-
To 
>unsubscribe, 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: multi-form page validation problem (client side)

2003-09-04 Thread Sieber Martin
Maybe I didn't make myself clear. This is not about the static code, but
about the dynamic code. If you read my original posting, than you will
see that I have put the static JavaScript already to false:
 However my mail prog removed the line brakes
and therefore this wasn't readable well. Apologies for that.

My problem is, that all the dynamic functions overwrite each other: 
mask(), maxlength(), ... are dynamic parts of the JavaScript, since the
ApplicationProperty labels are generated in there e.g.: function
maxlength () {
 this.aa = new Array("businessName", "BusinessName shouldn't be
longer than 50 characters.", new Function ("varName",
"this.maxlength='50';  return this[varName];"));
 this.ab = new Array("surname", "Other Text", new Function
("varName", "this.maxlength='50';  return this[varName];")); }

Cheers,
Martin

==
Original Message:

The html:javascript tag has a parameter named 'statisJavascript' which
says 
if Struts has to render all static code (i.e. the validations
functions). 
So, if you have several form in a page, you should write something like
this :




...

Thus, validation functions will appear only once.

HTH

Thomas

At 17:23 04/09/2003, you wrote:
>Hi,
>
>I'm having problems when validating a multiform page.
>I have 4 forms on a single page and I've set up the validation
framework
>for them. When I insert the html:javascript tag on the jsp page to
>create the dynamic code, it creates sth like this:
>
>
> function validateFrm_ccd_crn_Filter(form) {  [...]   }
> function maxlength () {  this.aa = [...]   }
>
>
> function validateFrm_ccd_par_Filter(form) {  [...]   }
> function maxlength () {  this.aa = }
> function mask () {  [...]}
>
>
> function validateFrm_ccd_pol_Filter(form) {[...]   }
> function maxlength () {  this.aa = [...]}
> function mask () {  this.aa = [...]}
>
>
>The problem is, that the mask and maxlength methods overwrite each
>other. Therefore the client side validation does work only for the last
>form that is used on the page.
>Anything that I should different than including:
>dynamicJavascript="true" /> dynamicJavascript="true" /> 
>dynamicJavascript="true" /> dynamicJavascript="true" /> on the JSP
page? 
>The server side validation works fine btw. Any help highly appreciated.

>Cheers, Martin 

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



Re: multi-form page validation problem (client side)

2003-09-04 Thread Thomas Cornet
The html:javascript tag has a parameter named 'statisJavascript' which says 
if Struts has to render all static code (i.e. the validations functions). 
So, if you have several form in a page, you should write something like this :




...
Thus, validation functions will appear only once.

HTH

Thomas

At 17:23 04/09/2003, you wrote:
Hi,

I'm having problems when validating a multiform page.
I have 4 forms on a single page and I've set up the validation framework
for them. When I insert the html:javascript tag on the jsp page to
create the dynamic code, it creates sth like this:

function validateFrm_ccd_crn_Filter(form) {  [...]   }
function maxlength () {  this.aa = [...]   }


function validateFrm_ccd_par_Filter(form) {  [...]   }
function maxlength () {  this.aa = }
function mask () {  [...]}


function validateFrm_ccd_pol_Filter(form) {[...]   }
function maxlength () {  this.aa = [...]}
function mask () {  this.aa = [...]}

The problem is, that the mask and maxlength methods overwrite each
other. Therefore the client side validation does work only for the last
form that is used on the page.
Anything that I should different than including:
dynamicJavascript="true" /> dynamicJavascript="true" /> 
dynamicJavascript="true" /> dynamicJavascript="true" /> on the JSP page? 
The server side validation works fine btw. Any help highly appreciated. 
Cheers, Martin 
- To 
unsubscribe, e-mail: [EMAIL PROTECTED] For 
additional commands, e-mail: [EMAIL PROTECTED]


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


multi-form page validation problem (client side)

2003-09-04 Thread Sieber Martin
Hi,

I'm having problems when validating a multiform page. 
I have 4 forms on a single page and I've set up the validation framework
for them. When I insert the html:javascript tag on the jsp page to
create the dynamic code, it creates sth like this:

 
function validateFrm_ccd_crn_Filter(form) {  [...]   } 
function maxlength () {  this.aa = [...]   }  

 
function validateFrm_ccd_par_Filter(form) {  [...]   } 
function maxlength () {  this.aa = } 
function mask () {  [...]} 

 
function validateFrm_ccd_pol_Filter(form) {[...]   } 
function maxlength () {  this.aa = [...]} 
function mask () {  this.aa = [...]} 


The problem is, that the mask and maxlength methods overwrite each
other. Therefore the client side validation does work only for the last
form that is used on the page.
Anything that I should different than including:




on the JSP page?

The server side validation works fine btw.

Any help highly appreciated.

Cheers,
Martin

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



DynaForm mapped property client-side validation problem

2003-07-22 Thread Steve Caswell
Using Struts 1.1.0, I'm having a problem with client-side validation of a map-backed 
property on a DynaValidationForm. The Javascript fails because of naming the form 
field using the map syntax. Here is my configuration:

I have the following DynaValidatorForm configured in struts-config.xml:


  


I have the following validation defined for this form in validator.xml:


  

  
  

  


And on the .jsp:


ValueD: 

 


ValueE: 

 






The problem is that the client-side Javascript validation fails to complete because 
the dynamic Javascript that gets generated is:

function required () { 
 this.aa = new Array("valueC", "???en_US.valueC.prompt??? must be entered", new 
Function ("varName", " return this[varName];"));
 this.ab = new Array("valueD", "Value D must be entered", new Function ("varName", 
" return this[varName];"));
} 

The reason the Javascript fails is that the name of the field for the second line 
above should be "longmap(valueD)", but the html:javascript tag builds it with just the 
key name, so the validateRequired() function fails when it tries to find a field with 
that name ("valueD").

I've looked all around the documentation and the mailing list archives, and I don't 
see anything specific to this case. Am I missing something, or is this a shortcoming 
of the html:javascript tag?

TIA.

Steve Caswell
[EMAIL PROTECTED]



Re: validation problem

2003-06-17 Thread salgado . pc
Check in your validation.xml if the messages (arg0, in this case) that are
binded with your error message is correct...
maybe it always returns the same error... (have you checked filling other form
fields and checking if messages change)?

Without the xml validation rule it is the best i can do... hope it works.

Pedro Salgado




 Internet Mail Message  
 Received from host:  daedalus.apache.org   
 [208.185.179.12]   



From: Aleksandar Matijaca <[EMAIL PROTECTED]> on 16-06-2003 23:35
   
  Aleksandar Matijaca   To:   [EMAIL PROTECTED]   
 <[EMAIL PROTECTED]>   Cc:(bcc: Pedroemanuel Salgado-PC/PGI)  
Subject:  validation problem   
   
 17-06-2003 00:35  
  Please respond to "Struts Users  
Mailing List"  
 <[EMAIL PROTECTED]>  
   






Hi there,

this is my first post!  I have inherited a web-based struts
project that is frankly a mess...  I have managed to straighten
out most things except something that is driving me nuts - this
is the problem:

Validation - I have 3 fields that need to be validated - if I do not
enter anything on all three fields, validation happens - I display
the messages in the JSP using the  'loop'.
However, the problem occurs if I fill in one of the fields, it
STILL reports that the first field is in error (the other two
which are unfilled are in error alos - this is a good thing), even though
there is
a value there (the validation is simple 'required').  If I fill in
ALL THREE FIELDS, then validation is OK, and I go on to the next
page.  There seems to be almost some kind of a "caching" of errors
that is happening, and I don't know how to "turn it off".

Thanks Alex.


-
To unsubscribe, 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: ValidatorBaseForm - Re: validation problem

2003-06-16 Thread David Graham
The ValidatorBaseForm simply extends ValidatorActionForm - sorry I fergot
to add that...
Oh, that might be why they used /public/EventRegistration as the form name.  
Try extending ValidatorForm and using the bean name defined in 
struts-config.xml instead.

David



On Mon, 16 Jun 2003, Aleksandar Matijaca wrote:

> Well, this is what I inherited:
>
>
>   
>
> 		 
>  	   depends="required,mask,minlength,maxlength">
>  	 
>  	 
> resource="false"/>
>  	 
> resource="false"/>
>
>  
>mask
>^[a-zA-Z]*$
>  
>  
>minlength
>2
>  
>  
>maxlength
>40
>  
>
>  
>
>  
>  	   depends="required,mask,minlength,maxlength">
>  	 
>  	 
> resource="false"/>
>  	 
> resource="false"/>
>  
>mask
>^[a-zA-Z]*$
>  
>  
>minlength
>2
>  
>  
>maxlength
>40
>  
>
>  
>
>
>  
>  	   depends="required,minlength,maxlength">
>  	 
>  	 
> resource="false"/>
>  	 
> resource="false"/>
>  
>minlength
>1
>  
>  
>maxlength
>40
>  
>
>  
>
> 	
>
>
>
> 
>
> The form-bean is:
>
>
> 
>
> type="ontario.exports.events.struts.EventRegistrationForm">
> 
>
> 
>
>
> The EventRegistrationForm extends EventDetailsForm which in-turn
> extends - ValidatorBaseForm
>
> These classes appear extremely messy and very long...
>
> Thanks, Alex.
>
>
>
> On Mon, 16 Jun 2003, David Graham wrote:
>
> > Post the relevant section of your validation xml file and more info 
about
> > your form.
> >
> > David
> >
> >
> > >
> > >Hi there,
> > >
> > >this is my first post!  I have inherited a web-based struts
> > >project that is frankly a mess...  I have managed to straighten
> > >out most things except something that is driving me nuts - this
> > >is the problem:
> > >
> > >Validation - I have 3 fields that need to be validated - if I do not
> > >enter anything on all three fields, validation happens - I display
> > >the messages in the JSP using the  'loop'.
> > >However, the problem occurs if I fill in one of the fields, it
> > >STILL reports that the first field is in error (the other two
> > >which are unfilled are in error alos - this is a good thing), even 
though
> > >there is
> > >a value there (the validation is simple 'required').  If I fill in
> > >ALL THREE FIELDS, then validation is OK, and I go on to the next
> > >page.  There seems to be almost some kind of a "caching" of errors
> > >that is happening, and I don't know how to "turn it off".
> > >
> > >Thanks Alex.
> > >
> > >
> > >-
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> > _
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re: validation problem

2003-06-16 Thread David Graham
I believe the form name must be the same as what you defined in 
struts-config.xml.  Try
 in your validation rules.

David

Well, this is what I inherited:

  

 
 
 
 
 
   mask
   ^[a-zA-Z]*$
 
 
   minlength
   2
 
 
   maxlength
   40
 
 

 
 
 
 
 
   mask
   ^[a-zA-Z]*$
 
 
   minlength
   2
 
 
   maxlength
   40
 
 

 
 
 
 
 
   minlength
   1
 
 
   maxlength
   40
 
 

	





The form-bean is:



type="ontario.exports.events.struts.EventRegistrationForm">



The EventRegistrationForm extends EventDetailsForm which in-turn
extends - ValidatorBaseForm
These classes appear extremely messy and very long...

Thanks, Alex.



On Mon, 16 Jun 2003, David Graham wrote:

> Post the relevant section of your validation xml file and more info 
about
> your form.
>
> David
>
>
> >
> >Hi there,
> >
> >this is my first post!  I have inherited a web-based struts
> >project that is frankly a mess...  I have managed to straighten
> >out most things except something that is driving me nuts - this
> >is the problem:
> >
> >Validation - I have 3 fields that need to be validated - if I do not
> >enter anything on all three fields, validation happens - I display
> >the messages in the JSP using the  'loop'.
> >However, the problem occurs if I fill in one of the fields, it
> >STILL reports that the first field is in error (the other two
> >which are unfilled are in error alos - this is a good thing), even 
though
> >there is
> >a value there (the validation is simple 'required').  If I fill in
> >ALL THREE FIELDS, then validation is OK, and I go on to the next
> >page.  There seems to be almost some kind of a "caching" of errors
> >that is happening, and I don't know how to "turn it off".
> >
> >Thanks Alex.
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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

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


ValidatorBaseForm - Re: validation problem

2003-06-16 Thread Aleksandar Matijaca


The ValidatorBaseForm simply extends ValidatorActionForm - sorry I fergot
to add that...



On Mon, 16 Jun 2003, Aleksandar Matijaca wrote:

> Well, this is what I inherited:
>
>
>   
>
>  depends="required,mask,minlength,maxlength">
>
> resource="false"/>
> resource="false"/>
>
>  
>mask
>^[a-zA-Z]*$
>  
>  
>minlength
>2
>  
>  
>maxlength
>40
>  
>
>  
>
>depends="required,mask,minlength,maxlength">
>
> resource="false"/>
> resource="false"/>
>  
>mask
>^[a-zA-Z]*$
>  
>  
>minlength
>2
>  
>  
>maxlength
>40
>  
>
>  
>
>
>depends="required,minlength,maxlength">
>
> resource="false"/>
> resource="false"/>
>  
>minlength
>1
>  
>  
>maxlength
>40
>  
>
>  
>
>   
>
>
>
> 
>
> The form-bean is:
>
>
> 
> type="ontario.exports.events.struts.EventRegistrationForm">
> 
>
> 
>
>
> The EventRegistrationForm extends EventDetailsForm which in-turn
> extends - ValidatorBaseForm
>
> These classes appear extremely messy and very long...
>
> Thanks, Alex.
>
>
>
> On Mon, 16 Jun 2003, David Graham wrote:
>
> > Post the relevant section of your validation xml file and more info about
> > your form.
> >
> > David
> >
> >
> > >
> > >Hi there,
> > >
> > >this is my first post!  I have inherited a web-based struts
> > >project that is frankly a mess...  I have managed to straighten
> > >out most things except something that is driving me nuts - this
> > >is the problem:
> > >
> > >Validation - I have 3 fields that need to be validated - if I do not
> > >enter anything on all three fields, validation happens - I display
> > >the messages in the JSP using the  'loop'.
> > >However, the problem occurs if I fill in one of the fields, it
> > >STILL reports that the first field is in error (the other two
> > >which are unfilled are in error alos - this is a good thing), even though
> > >there is
> > >a value there (the validation is simple 'required').  If I fill in
> > >ALL THREE FIELDS, then validation is OK, and I go on to the next
> > >page.  There seems to be almost some kind of a "caching" of errors
> > >that is happening, and I don't know how to "turn it off".
> > >
> > >Thanks Alex.
> > >
> > >
> > >-
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> > _
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> -
> To unsubscribe, 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 problem

2003-06-16 Thread Aleksandar Matijaca
Well, this is what I inherited:


  

 
 
 
 

 
   mask
   ^[a-zA-Z]*$
 
 
   minlength
   2
 
 
   maxlength
   40
 

 

 
 
 
 
 
   mask
   ^[a-zA-Z]*$
 
 
   minlength
   2
 
 
   maxlength
   40
 

 


 
 
 
 
 
   minlength
   1
 
 
   maxlength
   40
 

 







The form-bean is:








The EventRegistrationForm extends EventDetailsForm which in-turn
extends - ValidatorBaseForm

These classes appear extremely messy and very long...

Thanks, Alex.



On Mon, 16 Jun 2003, David Graham wrote:

> Post the relevant section of your validation xml file and more info about
> your form.
>
> David
>
>
> >
> >Hi there,
> >
> >this is my first post!  I have inherited a web-based struts
> >project that is frankly a mess...  I have managed to straighten
> >out most things except something that is driving me nuts - this
> >is the problem:
> >
> >Validation - I have 3 fields that need to be validated - if I do not
> >enter anything on all three fields, validation happens - I display
> >the messages in the JSP using the  'loop'.
> >However, the problem occurs if I fill in one of the fields, it
> >STILL reports that the first field is in error (the other two
> >which are unfilled are in error alos - this is a good thing), even though
> >there is
> >a value there (the validation is simple 'required').  If I fill in
> >ALL THREE FIELDS, then validation is OK, and I go on to the next
> >page.  There seems to be almost some kind of a "caching" of errors
> >that is happening, and I don't know how to "turn it off".
> >
> >Thanks Alex.
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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



Re: validation problem

2003-06-16 Thread David Graham
Post the relevant section of your validation xml file and more info about 
your form.

David


Hi there,

this is my first post!  I have inherited a web-based struts
project that is frankly a mess...  I have managed to straighten
out most things except something that is driving me nuts - this
is the problem:
Validation - I have 3 fields that need to be validated - if I do not
enter anything on all three fields, validation happens - I display
the messages in the JSP using the  'loop'.
However, the problem occurs if I fill in one of the fields, it
STILL reports that the first field is in error (the other two
which are unfilled are in error alos - this is a good thing), even though
there is
a value there (the validation is simple 'required').  If I fill in
ALL THREE FIELDS, then validation is OK, and I go on to the next
page.  There seems to be almost some kind of a "caching" of errors
that is happening, and I don't know how to "turn it off".
Thanks Alex.

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

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


validation problem

2003-06-16 Thread Aleksandar Matijaca

Hi there,

this is my first post!  I have inherited a web-based struts
project that is frankly a mess...  I have managed to straighten
out most things except something that is driving me nuts - this
is the problem:

Validation - I have 3 fields that need to be validated - if I do not
enter anything on all three fields, validation happens - I display
the messages in the JSP using the  'loop'.
However, the problem occurs if I fill in one of the fields, it
STILL reports that the first field is in error (the other two
which are unfilled are in error alos - this is a good thing), even though
there is
a value there (the validation is simple 'required').  If I fill in
ALL THREE FIELDS, then validation is OK, and I go on to the next
page.  There seems to be almost some kind of a "caching" of errors
that is happening, and I don't know how to "turn it off".

Thanks Alex.


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



RE: Validation Problem

2003-06-09 Thread Bailey, Shane C.

I didn't notice if you got your problem solved but it is a simple spelling
error:

   public void setField1(String feld1)
   {
this.field1 = field1;
   }

should be:

setField1(String field1)



-Original Message-
From: Thomas Miskiewicz [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 08, 2003 4:47 PM
To: Struts Users Mailing List
Subject: Validation Problem

Hi!

I now have a strange validation problem. I use this ActionForm class:

package com.mycompany;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import java.lang.String;

public class PostTestForm extends ActionForm
{
   private String field1 = "";
   private String field2 = "";
   private String field3 = "";

   private void checkForEmpty(String fieldName, String fieldKey, String
value,
  ActionErrors errors)
   {
if (value.trim().length() == 0)
{
 System.out.println(fieldName + value.trim().length());
 ActionError error = new ActionError("error.posttest.field.null",
fieldName);
 errors.add(fieldKey, error);
}
   }

   private void checkForLength(String fieldName, String fieldKey, String
value,
   int maxLength, ActionErrors errors)
   {
if (value.length() > maxLength)
{
 ActionError error =  new ActionError("error.posttest.field.length",
fieldName);
 System.out.println(maxLength);
 errors.add(fieldKey, error);
}
   }


   public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request)
   {
ActionErrors errors = new ActionErrors();

checkForEmpty("field1", "error.field1.empty", getField1(), errors);
checkForEmpty("field2", "error.field2.empty", getField2(), errors);
checkForEmpty("field3", "error.field3.empty", getField3(), errors);

checkForLength("field1", "error.field1.length", getField1(), 5, errors);
checkForLength("field2", "error.field2.length", getField2(), 5, errors);
checkForLength("field3", "error.field3.length", getField3(), 5, errors);

return errors;
   }

   public void reset(ActionMapping mapping, HttpServletRequest request)
   {
field1 = "";
field2 = "";
field3 = "";
   }

   public String getField1()
   {
return field1;
   }

   public void setField1(String feld1)
   {
this.field1 = field1;
   }

   public String getField2()
   {
return field2;
   }

   public void setField2(String field2)
   {
this.field2 = field2;
   }

   public String getField3()
   {
return field3;
   }

   public void setField3(String field3)
   {
this.field3 = field3;
   }

}

Everything works fine except the application always claims, that field1 is
empty
even if it's not. value.trim().length() always is = 0 with respect to the
field1.
The content of the HTML-Form looks like this:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>



  

  


  

  


  

  


  

  


  

  




What's wrong???

Regards
Tom


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

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



Re: Validation Problem

2003-06-08 Thread David Graham
The author is incorrect.  Check out 
http://jakarta.apache.org/struts/faqs/newbie.html#reset for more info.

David

> Well, these validations have already been coded for you and can be
> configured in an xml file by using the Validator.  I highly recommend 
you
> look into using the validator because it will save you a bunch of time.

I'll do soon. I getting acquainted with Struts working with the book
Professional Struts Applications. I still have 14 pages ahead the validator
framework. But before I jump to it, I'd like to understand why some
basics don't work to gain more confidence in the whole framework.
> Your problem may have something to do with setting the fields = "" in
reset.
>  I would put a stdout call in reset to see when it gets called.
I did that and reset gets called.
> If your forms are stored in the request (and I maybe even in the 
session)
then you
> don't need to implement the reset method at all.
They're being stored in the request. But wait a second. Why do you mean I
don't
need to implement the reset method? The guy in the book states:

"The reset() method is invoked only if the developer has declared that the
ActionForm
class should be stored in the request. This is necessary because Struts
maintains a cache
for each of the ActionForm classes. A single instance of an ActionForm 
class
can be
shared by multiple users for different reqests at different times. Hence,
the developer must
implement the reset() method to ensure that the end user never gets some
other user's
data"

How does this sound?

> It's really only needed to reset boolean properties.
He doesn't mention that...
Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Re: Validation Problem

2003-06-08 Thread Marco Tedone
Why don't you use ?

Marco
- Original Message - 
From: "Thomas Miskiewicz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 9:47 PM
Subject: Validation Problem


> Hi!
>
> I now have a strange validation problem. I use this ActionForm class:
>
> package com.mycompany;
>
> import org.apache.struts.action.Action;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionForward;
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.action.ActionError;
> import org.apache.struts.action.ActionServlet;
> import org.apache.struts.util.MessageResources;
>
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import javax.servlet.http.HttpSession;
>
> import java.lang.String;
>
> public class PostTestForm extends ActionForm
> {
>private String field1 = "";
>private String field2 = "";
>private String field3 = "";
>
>private void checkForEmpty(String fieldName, String fieldKey, String
> value,
>   ActionErrors errors)
>{
> if (value.trim().length() == 0)
> {
>  System.out.println(fieldName + value.trim().length());
>  ActionError error = new ActionError("error.posttest.field.null",
> fieldName);
>  errors.add(fieldKey, error);
> }
>}
>
>private void checkForLength(String fieldName, String fieldKey, String
> value,
>int maxLength, ActionErrors errors)
>{
> if (value.length() > maxLength)
> {
>  ActionError error =  new ActionError("error.posttest.field.length",
> fieldName);
>  System.out.println(maxLength);
>  errors.add(fieldKey, error);
> }
>}
>
>
>public ActionErrors validate(ActionMapping mapping,
>  HttpServletRequest request)
>{
> ActionErrors errors = new ActionErrors();
>
> checkForEmpty("field1", "error.field1.empty", getField1(), errors);
> checkForEmpty("field2", "error.field2.empty", getField2(), errors);
> checkForEmpty("field3", "error.field3.empty", getField3(), errors);
>
> checkForLength("field1", "error.field1.length", getField1(), 5,
errors);
> checkForLength("field2", "error.field2.length", getField2(), 5,
errors);
> checkForLength("field3", "error.field3.length", getField3(), 5,
errors);
>
> return errors;
>}
>
>public void reset(ActionMapping mapping, HttpServletRequest request)
>{
> field1 = "";
> field2 = "";
> field3 = "";
>}
>
>public String getField1()
>{
> return field1;
>}
>
>public void setField1(String feld1)
>{
> this.field1 = field1;
>}
>
>public String getField2()
>{
> return field2;
>}
>
>public void setField2(String field2)
>{
> this.field2 = field2;
>}
>
>public String getField3()
>{
> return field3;
>}
>
>public void setField3(String field3)
>{
> this.field3 = field3;
>}
>
> }
>
> Everything works fine except the application always claims, that field1 is
> empty
> even if it's not. value.trim().length() always is = 0 with respect to the
> field1.
> The content of the HTML-Form looks like this:
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
> 
>  style="border-collapse:collapse" bgcolor="E7E7E7" width="100%"
> height="900px">
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
> 
>
> What's wrong???
>
> Regards
> Tom
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




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



Re: Validation Problem

2003-06-08 Thread Thomas Miskiewicz
David,

> Well, these validations have already been coded for you and can be
> configured in an xml file by using the Validator.  I highly recommend you
> look into using the validator because it will save you a bunch of time.

I'll do soon. I getting acquainted with Struts working with the book
Professional Struts Applications. I still have 14 pages ahead the validator
framework. But before I jump to it, I'd like to understand why some
basics don't work to gain more confidence in the whole framework.

> Your problem may have something to do with setting the fields = "" in
reset.
>  I would put a stdout call in reset to see when it gets called.
I did that and reset gets called.

> If your forms are stored in the request (and I maybe even in the session)
then you
> don't need to implement the reset method at all.
They're being stored in the request. But wait a second. Why do you mean I
don't
need to implement the reset method? The guy in the book states:

"The reset() method is invoked only if the developer has declared that the
ActionForm
class should be stored in the request. This is necessary because Struts
maintains a cache
for each of the ActionForm classes. A single instance of an ActionForm class
can be
shared by multiple users for different reqests at different times. Hence,
the developer must
implement the reset() method to ensure that the end user never gets some
other user's
data"

How does this sound?

> It's really only needed to reset boolean properties.
He doesn't mention that...

Tom


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



Re: Validation Problem

2003-06-08 Thread David Graham
Well, these validations have already been coded for you and can be 
configured in an xml file by using the Validator.  I highly recommend you 
look into using the validator because it will save you a bunch of time.

Your problem may have something to do with setting the fields = "" in reset. 
 I would put a stdout call in reset to see when it gets called.  If your 
forms are stored in the request (and I maybe even in the session) then you 
don't need to implement the reset method at all.  It's really only needed to 
reset boolean properties.

David


From: "Thomas Miskiewicz" <[EMAIL PROTECTED]>
Reply-To: "Thomas Miskiewicz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Validation Problem
Date: Sun, 8 Jun 2003 22:47:25 +0200
Hi!

I now have a strange validation problem. I use this ActionForm class:

package com.mycompany;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.lang.String;

public class PostTestForm extends ActionForm
{
   private String field1 = "";
   private String field2 = "";
   private String field3 = "";
   private void checkForEmpty(String fieldName, String fieldKey, String
value,
  ActionErrors errors)
   {
if (value.trim().length() == 0)
{
 System.out.println(fieldName + value.trim().length());
 ActionError error = new ActionError("error.posttest.field.null",
fieldName);
 errors.add(fieldKey, error);
}
   }
   private void checkForLength(String fieldName, String fieldKey, String
value,
   int maxLength, ActionErrors errors)
   {
if (value.length() > maxLength)
{
 ActionError error =  new ActionError("error.posttest.field.length",
fieldName);
 System.out.println(maxLength);
 errors.add(fieldKey, error);
}
   }
   public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request)
   {
ActionErrors errors = new ActionErrors();
checkForEmpty("field1", "error.field1.empty", getField1(), errors);
checkForEmpty("field2", "error.field2.empty", getField2(), errors);
checkForEmpty("field3", "error.field3.empty", getField3(), errors);
checkForLength("field1", "error.field1.length", getField1(), 5, 
errors);
checkForLength("field2", "error.field2.length", getField2(), 5, 
errors);
checkForLength("field3", "error.field3.length", getField3(), 5, 
errors);

return errors;
   }
   public void reset(ActionMapping mapping, HttpServletRequest request)
   {
field1 = "";
field2 = "";
field3 = "";
   }
   public String getField1()
   {
return field1;
   }
   public void setField1(String feld1)
   {
this.field1 = field1;
   }
   public String getField2()
   {
return field2;
   }
   public void setField2(String field2)
   {
this.field2 = field2;
   }
   public String getField3()
   {
return field3;
   }
   public void setField3(String field3)
   {
this.field3 = field3;
   }
}

Everything works fine except the application always claims, that field1 is
empty
even if it's not. value.trim().length() always is = 0 with respect to the
field1.
The content of the HTML-Form looks like this:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>



  

  


  

  


  

  


  

  


  

  



What's wrong???

Regards
Tom
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Validation Problem

2003-06-08 Thread Thomas Miskiewicz
Hi!

I now have a strange validation problem. I use this ActionForm class:

package com.mycompany;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import java.lang.String;

public class PostTestForm extends ActionForm
{
   private String field1 = "";
   private String field2 = "";
   private String field3 = "";

   private void checkForEmpty(String fieldName, String fieldKey, String
value,
  ActionErrors errors)
   {
if (value.trim().length() == 0)
{
 System.out.println(fieldName + value.trim().length());
 ActionError error = new ActionError("error.posttest.field.null",
fieldName);
 errors.add(fieldKey, error);
}
   }

   private void checkForLength(String fieldName, String fieldKey, String
value,
   int maxLength, ActionErrors errors)
   {
if (value.length() > maxLength)
{
 ActionError error =  new ActionError("error.posttest.field.length",
fieldName);
 System.out.println(maxLength);
 errors.add(fieldKey, error);
}
   }


   public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request)
   {
ActionErrors errors = new ActionErrors();

checkForEmpty("field1", "error.field1.empty", getField1(), errors);
checkForEmpty("field2", "error.field2.empty", getField2(), errors);
checkForEmpty("field3", "error.field3.empty", getField3(), errors);

checkForLength("field1", "error.field1.length", getField1(), 5, errors);
checkForLength("field2", "error.field2.length", getField2(), 5, errors);
checkForLength("field3", "error.field3.length", getField3(), 5, errors);

return errors;
   }

   public void reset(ActionMapping mapping, HttpServletRequest request)
   {
field1 = "";
field2 = "";
field3 = "";
   }

   public String getField1()
   {
return field1;
   }

   public void setField1(String feld1)
   {
this.field1 = field1;
   }

   public String getField2()
   {
return field2;
   }

   public void setField2(String field2)
   {
this.field2 = field2;
   }

   public String getField3()
   {
return field3;
   }

   public void setField3(String field3)
   {
this.field3 = field3;
   }

}

Everything works fine except the application always claims, that field1 is
empty
even if it's not. value.trim().length() always is = 0 with respect to the
field1.
The content of the HTML-Form looks like this:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>



  

  


  

  


  

  


  

  


  

  




What's wrong???

Regards
Tom


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



RE: Multiple forms with same format and validation problem.

2003-03-09 Thread Jason Long
Everything is working nicely now.  Many thanks to Dave Newton and Harish
Krishnaswamy for your help.
Dave you are right if I had nickle

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 3:57 PM
To: Jason Long
Subject: RE: Multiple forms with same format and validation problem.


> 1. request.getAttribute("page") is returning null and I cannot use the
> action form methods for inside this class even though it is being passed
in.

It should be request.getParameter("page")

Dontcha hate that? If I had a nickel for every time I've done that...
well, I'd have like $.15, but still.

> 2. My form field values are filled in except the errors are not being
> displayed an the page anymore.

ActionErrors errs = form.validate(mapping, request);
if ((errs != null) && !errs.isEmpty()) {
saveErrors(request, errs);
}

See if that does the trick!

Dave




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



RE: Multiple forms with same format and validation problem.

2003-03-09 Thread harish krishnaswamy
1. Your form fields can be found in the ActionForm
being passed in to the Action.execute() method.
2. you can save your errors in an
ActionErrors/ActionMessages like shown below from with
the execute method:

ActionMessages msgs = new ActionMessages();
msgs.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage(Globals.NEW_PROCESS_ERROR_CREATE));
this.saveMessages(request, msgs);

-Harish

--- Jason Long <[EMAIL PROTECTED]> wrote:
> I am still having the following two problems:
> 
> Problems:
> 1. request.getAttribute("page") is returning null
> and I cannot use the
> action form methods for inside this class even
> though it is being passed in.
>It does work with return new
> ActionForward("/itemConfig_6.jsp") hard
> coded.
> 2. My form field values are filled in except the
> errors are not being
> displayed an the page anymore.
> 
> Questions:
> 1. How do I access a form field value from within
> ItemConfigAction?
> 2. How do I send the ActionErrors back to the page
> for display?
> 
> 
> Current inadequate solution:
> I added a similar hidden field to each page as
> follows:
>  type="hidden"/>
> 
> I also moved my validation to
>public ActionForward perform(ActionMapping
> mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response)
>   throws IOException, ServletException {
> errors = form.validate(mapping,request);
> if(errors.empty()) {
> // Forward control to the specified success
> URI
>   return (mapping.findForward("success"));
> } else {
>   return new
> ActionForward("/"+request.getAttribute("page"));
> }
> }
> 
> Thank you for your time,
> 
> Jason Long - CEO and Chief Software Engineer
> Supernova Software - supernovasoftware.com
> BS Physics, MS  Chemical Engineering
> 
> -Original Message-
> From: Dave Newton [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 09, 2003 8:02 AM
> To: Struts Users Mailing List
> Subject: RE: Multiple forms with same format and
> validation problem.
> 
> 
> > I have no way of knowing all of the forwards.  The
> pages are generated
> > dynamically when a new inventory is uploaded.  I
> just need a way to
> specify
> > this in each jsp page.
> 
> Could you just have the input page's path as a
> hidden form field and
> create a new ActionForward in the Action rather than
> looking it up in
> the mapping? You might need to play some games with
> the formbean.
> 
> Dave
> 
> 
> 
>
-
> To unsubscribe, 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! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



RE: Multiple forms with same format and validation problem.

2003-03-09 Thread Jason Long
I am still having the following two problems:

Problems:
1. request.getAttribute("page") is returning null and I cannot use the
action form methods for inside this class even though it is being passed in.
   It does work with return new ActionForward("/itemConfig_6.jsp") hard
coded.
2. My form field values are filled in except the errors are not being
displayed an the page anymore.

Questions:
1. How do I access a form field value from within ItemConfigAction?
2. How do I send the ActionErrors back to the page for display?


Current inadequate solution:
I added a similar hidden field to each page as follows:


I also moved my validation to
   public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws IOException, ServletException {
errors = form.validate(mapping,request);
if(errors.empty()) {
  // Forward control to the specified success URI
  return (mapping.findForward("success"));
} else {
  return new ActionForward("/"+request.getAttribute("page"));
}
}

Thank you for your time,

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 8:02 AM
To: Struts Users Mailing List
Subject: RE: Multiple forms with same format and validation problem.


> I have no way of knowing all of the forwards.  The pages are generated
> dynamically when a new inventory is uploaded.  I just need a way to
specify
> this in each jsp page.

Could you just have the input page's path as a hidden form field and
create a new ActionForward in the Action rather than looking it up in
the mapping? You might need to play some games with the formbean.

Dave



-
To unsubscribe, 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: Multiple forms with same format and validation problem.

2003-03-09 Thread Jason Long
I moved my validiations to the action, and I am going to try to using the
hidden field to redirect back to the proper page.  Is there some other way
to detect the page that way orginally posted from, without using a hidden
field as suggested by Dave Newton <[EMAIL PROTECTED]>?

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering

-Original Message-
From: harish krishnaswamy [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 11:43 AM
To: Struts Users Mailing List
Subject: RE: Multiple forms with same format and validation problem.


It has been recommended that ActionForm.validate() be
used only for trivial validations like the input
format, range etc. And these validations can be pushed
to the browser and caught there instead. The other
business validations are recommended to be done in the
Action classes like its been pointed out in the other
messages, that way you avoid this whole problem.

-Harish


--- Dave Newton <[EMAIL PROTECTED]> wrote:
> > I have no way of knowing all of the forwards.  The
> pages are generated
> > dynamically when a new inventory is uploaded.  I
> just need a way to specify
> > this in each jsp page.
>
> Could you just have the input page's path as a
> hidden form field and
> create a new ActionForward in the Action rather than
> looking it up in
> the mapping? You might need to play some games with
> the formbean.
>
> Dave
>
>
>
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.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: Multiple forms with same format and validation problem.

2003-03-09 Thread harish krishnaswamy
It has been recommended that ActionForm.validate() be
used only for trivial validations like the input
format, range etc. And these validations can be pushed
to the browser and caught there instead. The other
business validations are recommended to be done in the
Action classes like its been pointed out in the other
messages, that way you avoid this whole problem.

-Harish


--- Dave Newton <[EMAIL PROTECTED]> wrote:
> > I have no way of knowing all of the forwards.  The
> pages are generated
> > dynamically when a new inventory is uploaded.  I
> just need a way to specify
> > this in each jsp page.
> 
> Could you just have the input page's path as a
> hidden form field and
> create a new ActionForward in the Action rather than
> looking it up in
> the mapping? You might need to play some games with
> the formbean.
> 
> Dave
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



RE: Multiple forms with same format and validation problem.

2003-03-09 Thread Dave Newton
> I have no way of knowing all of the forwards.  The pages are generated
> dynamically when a new inventory is uploaded.  I just need a way to specify
> this in each jsp page.

Could you just have the input page's path as a hidden form field and
create a new ActionForward in the Action rather than looking it up in
the mapping? You might need to play some games with the formbean.

Dave



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



RE: Multiple forms with same format and validation problem.

2003-03-09 Thread Jason Long
I have seen this solution, but it is not exactly what I am looking for:
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]
he.org&msgNo=67489

I have no way of knowing all of the forwards.  The pages are generated
dynamically when a new inventory is uploaded.  I just need a way to specify
this in each jsp page.

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering

-Original Message-
From: Jason Long [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 1:58 AM
To: [EMAIL PROTECTED]
Subject: Multiple forms with same format and validation problem.


I have an application that creates hundreds of jsp/struts form pages in xml
format.  All pages have the same input fields, except that there is a
varying number of checkbox fields.  I specified the following action:



  


The problem is that there are many pages name itemConfig_X.jsp, but with
this setup it is constantly redirected to itemConfig_0.jsp when validation
fails.  I need to know how to make each page use itself for input.  I would
appreciate any advice.  This project is already running behind schedule, so
I need to resolve this problem quickly.

Thank you for your time,

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering



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



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



Multiple forms with same format and validation problem.

2003-03-08 Thread Jason Long
I have an application that creates hundreds of jsp/struts form pages in xml
format.  All pages have the same input fields, except that there is a
varying number of checkbox fields.  I specified the following action:



  


The problem is that there are many pages name itemConfig_X.jsp, but with
this setup it is constantly redirected to itemConfig_0.jsp when validation
fails.  I need to know how to make each page use itself for input.  I would
appreciate any advice.  This project is already running behind schedule, so
I need to resolve this problem quickly.

Thank you for your time,

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering



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



Client Side validation problem with Struts 1.1 RC1

2003-03-06 Thread Camper Richard D
I deployed the struts-validator.war file to both Tomcat 4.1 and
Websphere 5.0 (via WSAD 5.0).  I am not geting any client-side
validation. When I viewing source via the browser for the
jsRegistration.jsp page, I noticed that the page did not contain any of
the validator java script that the  tag should have generated.

If I remove the reference to the validator_1_0.dtd from the
validator-rules.xml and validation.xml files I.E delete
http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>

Then the client side validation works.


DISCLAIMER:
The information contained in this e-mail may be confidential and is intended solely 
for the use of the named addressee. Access, copying or re-use of the e-mail or any 
information contained therein by any other person is not authorized. If you are not 
the intended recipient please notify us immediately by returning the e-mail to the 
originator.

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



Re: Validation problem

2003-02-20 Thread Ian Hunter
The only thing I can think of is that the particular key you're referring to
isn't present.  If you want to, post your errors.add() code as well as your
application resource bundle.
- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:55 PM
Subject: RE: Validation problem


> no app did not complain
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:55
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> Did the  tag cause your app to complain about not having
> the resources loaded?
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:51 PM
> Subject: RE: Validation problem
>
>
> > I implemented your second option.
> >
> > -Oorspronkelijk bericht-
> > Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> > Verzonden: donderdag 20 februari 2003 22:35
> > Aan: Struts Users Mailing List
> > Onderwerp: Re: Validation problem
> >
> >
> > Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?
> >
> > 1)  If you changed your JSP to  or
> > something, keep this in mind: I use a class called "Constants" for each
> web
> > app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
> > sure that my JSP has the correct text.  What is the name of the
> property/key
> > you're assigning the error to?
> >
> > 2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale
is
> > right and your Resource bundle has the appropriate text key?
> >
> > Try throwing this code in your JSP:
> >
> >  > scope="application">
> >   
> > ERROR:  Language independent messages not loaded -- contact
> > administrator
> > for assistance.
> >   
> > 
> >
> >
> > - Original Message -
> > From: "Johan Kumps" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 20, 2003 4:25 PM
> > Subject: RE: Validation problem
> >
> >
> > > Thanks for your help.
> > >
> > > My jsp is displaying : ???nl_BE.error.invalid.email???
> > >
> > > Still something wrong. It seems my key is not found.
> > >
> > > Can you help me again please?
> > >
> > > Kind regards,
> > >
> > > -Oorspronkelijk bericht-
> > > Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> > > Verzonden: donderdag 20 februari 2003 22:15
> > > Aan: Struts Users Mailing List
> > > Onderwerp: Re: Validation problem
> > >
> > >
> > > When you add your error message to the errors object, you are
specifying
> > > Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have
> to
> > do
> > > something like
> > >
> > >  to get that SPECIFIC error.  If
you
> > > switch to ActionErrors.GLOBAL_ERROR it will display all of them with
> just
> > > 
> > >
> > >
> > > - Original Message -
> > > From: "Johan Kumps" <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > Sent: Thursday, February 20, 2003 4:02 PM
> > > Subject: Validation problem
> > >
> > >
> > > > Hi all,
> > > >
> > > > I have a problem displaying error messages. Why is my message not
> > > displayed?
> > > > Am I doing somthing wrong?
> > > >
> > > > Please help me, I'm loosing time with this one...
> > > >
> > > > Please consider following code :
> > > >
> > > > Form class :
> > > >
> > > > ...
> > > >
> > > > public ActionErrors validate(ActionMapping mapping,
HttpServletRequest
> > > > request) {
> > > > ActionErrors errors = new ActionErrors();
> > > >
> > > > if(email == null || !checkEmail(email)) {
> > > > errors.add(Action.ERROR_KEY, new
> > > > ActionError("error.invalid.email"));
> > > > }
> > > > return errors;
> > > > }
> > > >
> > >
> > 

RE: Validation problem

2003-02-20 Thread Johan Kumps
no app did not complain

-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:55
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem


Did the  tag cause your app to complain about not having
the resources loaded?

- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:51 PM
Subject: RE: Validation problem


> I implemented your second option.
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:35
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?
>
> 1)  If you changed your JSP to  or
> something, keep this in mind: I use a class called "Constants" for each
web
> app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
> sure that my JSP has the correct text.  What is the name of the
property/key
> you're assigning the error to?
>
> 2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale is
> right and your Resource bundle has the appropriate text key?
>
> Try throwing this code in your JSP:
>
>  scope="application">
>   
> ERROR:  Language independent messages not loaded -- contact
> administrator
> for assistance.
>   
> 
>
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:25 PM
> Subject: RE: Validation problem
>
>
> > Thanks for your help.
> >
> > My jsp is displaying : ???nl_BE.error.invalid.email???
> >
> > Still something wrong. It seems my key is not found.
> >
> > Can you help me again please?
> >
> > Kind regards,
> >
> > -Oorspronkelijk bericht-
> > Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> > Verzonden: donderdag 20 februari 2003 22:15
> > Aan: Struts Users Mailing List
> > Onderwerp: Re: Validation problem
> >
> >
> > When you add your error message to the errors object, you are specifying
> > Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have
to
> do
> > something like
> >
> >  to get that SPECIFIC error.  If you
> > switch to ActionErrors.GLOBAL_ERROR it will display all of them with
just
> > 
> >
> >
> > - Original Message -
> > From: "Johan Kumps" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 20, 2003 4:02 PM
> > Subject: Validation problem
> >
> >
> > > Hi all,
> > >
> > > I have a problem displaying error messages. Why is my message not
> > displayed?
> > > Am I doing somthing wrong?
> > >
> > > Please help me, I'm loosing time with this one...
> > >
> > > Please consider following code :
> > >
> > > Form class :
> > >
> > > ...
> > >
> > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > > request) {
> > > ActionErrors errors = new ActionErrors();
> > >
> > > if(email == null || !checkEmail(email)) {
> > > errors.add(Action.ERROR_KEY, new
> > > ActionError("error.invalid.email"));
> > > }
> > > return errors;
> > > }
> > >
> >
> > > JSP :
> > >
> > > 
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
> >
> > ---
> > This mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe

Re: Validation problem

2003-02-20 Thread Ian Hunter
Did the  tag cause your app to complain about not having
the resources loaded?

- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:51 PM
Subject: RE: Validation problem


> I implemented your second option.
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:35
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?
>
> 1)  If you changed your JSP to  or
> something, keep this in mind: I use a class called "Constants" for each
web
> app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
> sure that my JSP has the correct text.  What is the name of the
property/key
> you're assigning the error to?
>
> 2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale is
> right and your Resource bundle has the appropriate text key?
>
> Try throwing this code in your JSP:
>
>  scope="application">
>   
> ERROR:  Language independent messages not loaded -- contact
> administrator
> for assistance.
>   
> 
>
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:25 PM
> Subject: RE: Validation problem
>
>
> > Thanks for your help.
> >
> > My jsp is displaying : ???nl_BE.error.invalid.email???
> >
> > Still something wrong. It seems my key is not found.
> >
> > Can you help me again please?
> >
> > Kind regards,
> >
> > -Oorspronkelijk bericht-
> > Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> > Verzonden: donderdag 20 februari 2003 22:15
> > Aan: Struts Users Mailing List
> > Onderwerp: Re: Validation problem
> >
> >
> > When you add your error message to the errors object, you are specifying
> > Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have
to
> do
> > something like
> >
> >  to get that SPECIFIC error.  If you
> > switch to ActionErrors.GLOBAL_ERROR it will display all of them with
just
> > 
> >
> >
> > - Original Message -
> > From: "Johan Kumps" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 20, 2003 4:02 PM
> > Subject: Validation problem
> >
> >
> > > Hi all,
> > >
> > > I have a problem displaying error messages. Why is my message not
> > displayed?
> > > Am I doing somthing wrong?
> > >
> > > Please help me, I'm loosing time with this one...
> > >
> > > Please consider following code :
> > >
> > > Form class :
> > >
> > > ...
> > >
> > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > > request) {
> > > ActionErrors errors = new ActionErrors();
> > >
> > > if(email == null || !checkEmail(email)) {
> > > errors.add(Action.ERROR_KEY, new
> > > ActionError("error.invalid.email"));
> > > }
> > > return errors;
> > > }
> > >
> >
> > > JSP :
> > >
> > > 
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
> >
> > ---
> > This mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
> ---
> This mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
>
> -
> To unsubscribe, 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 problem

2003-02-20 Thread Johan Kumps
I implemented your second option.

-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:35
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem


Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?

1)  If you changed your JSP to  or
something, keep this in mind: I use a class called "Constants" for each web
app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
sure that my JSP has the correct text.  What is the name of the property/key
you're assigning the error to?

2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale is
right and your Resource bundle has the appropriate text key?

Try throwing this code in your JSP:


  
ERROR:  Language independent messages not loaded -- contact
administrator
for assistance.
  



- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:25 PM
Subject: RE: Validation problem


> Thanks for your help.
>
> My jsp is displaying : ???nl_BE.error.invalid.email???
>
> Still something wrong. It seems my key is not found.
>
> Can you help me again please?
>
> Kind regards,
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:15
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> When you add your error message to the errors object, you are specifying
> Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to
do
> something like
>
>  to get that SPECIFIC error.  If you
> switch to ActionErrors.GLOBAL_ERROR it will display all of them with just
> 
>
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:02 PM
> Subject: Validation problem
>
>
> > Hi all,
> >
> > I have a problem displaying error messages. Why is my message not
> displayed?
> > Am I doing somthing wrong?
> >
> > Please help me, I'm loosing time with this one...
> >
> > Please consider following code :
> >
> > Form class :
> >
> > ...
> >
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> > ActionErrors errors = new ActionErrors();
> >
> > if(email == null || !checkEmail(email)) {
> > errors.add(Action.ERROR_KEY, new
> > ActionError("error.invalid.email"));
> > }
> > return errors;
> > }
> >
>
> > JSP :
> >
> > 
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
> ---
> This mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




Re: Validation problem

2003-02-20 Thread Ian Hunter
Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?

1)  If you changed your JSP to  or
something, keep this in mind: I use a class called "Constants" for each web
app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
sure that my JSP has the correct text.  What is the name of the property/key
you're assigning the error to?

2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale is
right and your Resource bundle has the appropriate text key?

Try throwing this code in your JSP:


  
ERROR:  Language independent messages not loaded -- contact
administrator
for assistance.
  



- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:25 PM
Subject: RE: Validation problem


> Thanks for your help.
>
> My jsp is displaying : ???nl_BE.error.invalid.email???
>
> Still something wrong. It seems my key is not found.
>
> Can you help me again please?
>
> Kind regards,
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:15
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> When you add your error message to the errors object, you are specifying
> Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to
do
> something like
>
>  to get that SPECIFIC error.  If you
> switch to ActionErrors.GLOBAL_ERROR it will display all of them with just
> 
>
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:02 PM
> Subject: Validation problem
>
>
> > Hi all,
> >
> > I have a problem displaying error messages. Why is my message not
> displayed?
> > Am I doing somthing wrong?
> >
> > Please help me, I'm loosing time with this one...
> >
> > Please consider following code :
> >
> > Form class :
> >
> > ...
> >
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> > ActionErrors errors = new ActionErrors();
> >
> > if(email == null || !checkEmail(email)) {
> > errors.add(Action.ERROR_KEY, new
> > ActionError("error.invalid.email"));
> > }
> > return errors;
> > }
> >
>
> > JSP :
> >
> > 
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
> ---
> This mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
>
> -
> To unsubscribe, 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 problem

2003-02-20 Thread Johan Kumps
Thanks for your help.

My jsp is displaying : ???nl_BE.error.invalid.email???

Still something wrong. It seems my key is not found.

Can you help me again please?

Kind regards,

-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:15
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem


When you add your error message to the errors object, you are specifying
Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to do
something like

 to get that SPECIFIC error.  If you
switch to ActionErrors.GLOBAL_ERROR it will display all of them with just



- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:02 PM
Subject: Validation problem


> Hi all,
>
> I have a problem displaying error messages. Why is my message not
displayed?
> Am I doing somthing wrong?
>
> Please help me, I'm loosing time with this one...
>
> Please consider following code :
>
> Form class :
>
> ...
>
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
> ActionErrors errors = new ActionErrors();
>
> if(email == null || !checkEmail(email)) {
> errors.add(Action.ERROR_KEY, new
> ActionError("error.invalid.email"));
> }
> return errors;
> }
>

> JSP :
>
> 


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




Re: Validation problem

2003-02-20 Thread Ian Hunter
When you add your error message to the errors object, you are specifying
Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to do
something like

 to get that SPECIFIC error.  If you
switch to ActionErrors.GLOBAL_ERROR it will display all of them with just



- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:02 PM
Subject: Validation problem


> Hi all,
>
> I have a problem displaying error messages. Why is my message not
displayed?
> Am I doing somthing wrong?
>
> Please help me, I'm loosing time with this one...
>
> Please consider following code :
>
> Form class :
>
> ...
>
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
> ActionErrors errors = new ActionErrors();
>
> if(email == null || !checkEmail(email)) {
> errors.add(Action.ERROR_KEY, new
> ActionError("error.invalid.email"));
> }
> return errors;
> }
>

> JSP :
>
> 


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




Re: Validation problem

2003-02-20 Thread alexj
have you try to restart tomcat ?

- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 10:02 PM
Subject: Validation problem


> Hi all,
>
> I have a problem displaying error messages. Why is my message not
displayed?
> Am I doing somthing wrong?
>
> Please help me, I'm loosing time with this one...
>
> Please consider following code :
>
> struts-config.xml :
>
> ...
>
> 
> ...
>type="SomeAction"
>   name="someForm"
>   scope="request"
>   validate="true"
>   input="/index.jsp"
>   parameter="get">
>   
> 
> ...
>
> Form class :
>
> ...
>
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
> ActionErrors errors = new ActionErrors();
>
> if(email == null || !checkEmail(email)) {
> errors.add(Action.ERROR_KEY, new
> ActionError("error.invalid.email"));
> }
> return errors;
> }
>
> private boolean checkEmail (String email) {
> if ((email != null) && (email.trim().length() != 0)){
> String stukNaAt = null;
> if (email.indexOf("@") != -1){
> stukNaAt = email.substring(email.indexOf("@"));
> } else {
> return false;
> }
> if ((email.indexOf("@") != email.lastIndexOf("@")) ||
> (email.indexOf(" ") != -1) ||
> (stukNaAt.indexOf(".") == -1)
> (stukNaAt.indexOf(".") == stukNaAt.length() -1) ||
> (email.trim().charAt(email.trim().length()-1) =='.') ) {
> return false;
> }
> } else {
> return false;
> }
> return true;
> }
>
> ...
>
> ApplicationResources.properties in /WEB-INF/classes
>
> error.invalid.email=Please provide us with a valid e-mail address.
>
> JSP :
>
> 
>
>
> ---
> This mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
>
> -
> To unsubscribe, 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 problem

2003-02-20 Thread Johan Kumps
Hi all,

I have a problem displaying error messages. Why is my message not displayed?
Am I doing somthing wrong?

Please help me, I'm loosing time with this one...

Please consider following code :

struts-config.xml :

...


...

  

...

Form class :

...

public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();

if(email == null || !checkEmail(email)) {
errors.add(Action.ERROR_KEY, new
ActionError("error.invalid.email"));
}
return errors;
}

private boolean checkEmail (String email) {
if ((email != null) && (email.trim().length() != 0)){
String stukNaAt = null;
if (email.indexOf("@") != -1){
stukNaAt = email.substring(email.indexOf("@"));
} else {
return false;
}
if ((email.indexOf("@") != email.lastIndexOf("@")) ||
(email.indexOf(" ") != -1) ||
(stukNaAt.indexOf(".") == -1)
(stukNaAt.indexOf(".") == stukNaAt.length() -1) ||
(email.trim().charAt(email.trim().length()-1) =='.') ) {
return false;
}
} else {
return false;
}
return true;
}

...

ApplicationResources.properties in /WEB-INF/classes

error.invalid.email=Please provide us with a valid e-mail address.

JSP :




---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




validation problem with JVM of j2sdk1.4.1_01

2002-12-13 Thread Iris
Hello,

I've spend hours to find why my validation suddenly doesn't work.
When I remembered that I've change my JVM j2sdk1.4.0 to j2sdk1.4.1_01,
effectivly if when I put back the JVM j2sdk1.4, the validation works again.

I doesn't find any bug report on this.
Is anybody else had a validation problem with the j2sdk1.4.1_01 ?

Iris


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




Re: DispatchAction CRUD validation problem

2002-12-12 Thread V. Cekvenich
One way is to have validate="flase"
and in your CRUD events manually call validate().

.V

adam kramer wrote:

 I'd like to use a DispatchAction to handle the Create,Read,Update and
Delete actions for an object. But I can't work Read into the mix because
of the action-mapping configuration and the validation setting.
I want form validation to be TRUE for C, U and D but FALSE for Read, else
it never gets to the form because its trying to display the form in the
first place. For instance:


		


You can't have validate both ways.
Has anyone figured out how to integrate READ into the CRUD DispatchAction?
Or do I need to make a different action mapping for READ (for showing a
blank ADD page, and a filled Modify/EDIT page).

thanks in advance,
adam k.





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




DispatchAction CRUD validation problem

2002-12-12 Thread adam kramer

 I'd like to use a DispatchAction to handle the Create,Read,Update and
Delete actions for an object. But I can't work Read into the mix because
of the action-mapping configuration and the validation setting.
I want form validation to be TRUE for C, U and D but FALSE for Read, else
it never gets to the form because its trying to display the form in the
first place. For instance:





You can't have validate both ways.
Has anyone figured out how to integrate READ into the CRUD DispatchAction?
Or do I need to make a different action mapping for READ (for showing a
blank ADD page, and a filled Modify/EDIT page).

thanks in advance,
adam k.


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




Re: Struts file upload validation problem

2002-11-20 Thread Martin Cooper


On Wed, 20 Nov 2002, Eddie Bush wrote:

> Brian Hickey wrote:
>
> >Martin is correct :o)
> >
> >Also be aware that very very large files can exceed the setting of Java temp
> >space (memory) allocation is some containers and crash them.
> >
> >One approach that works is to write a simple file upload script in Perl.
> >This allows you to check content-type, size, etc. and reject the upload
> >before trouble happens. It is also platform independent to a "reasonable"
> >degree.
> >
> Unless I'm mistaken, the commons file-upload component can do this too.
>  Am I mistaken?

Commons FileUpload has a size threshold below which a part is retained in
memory, and above which it is streamed to disk, to prevent memory issues.
It also has another size threshold that determines the maximum total size
of a request that it will accept, beyond which it will throw up its hands
and refuse to process the request at all.

--
Martin Cooper


>
> >Just another $.02 worth...
> >
> >Brian
> >
> --
> Eddie Bush
>
>
>
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
>
>


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




Re: Struts file upload validation problem

2002-11-20 Thread Eddie Bush
Brian Hickey wrote:


Martin is correct :o)

Also be aware that very very large files can exceed the setting of Java temp
space (memory) allocation is some containers and crash them.

One approach that works is to write a simple file upload script in Perl.
This allows you to check content-type, size, etc. and reject the upload
before trouble happens. It is also platform independent to a "reasonable"
degree.


Unless I'm mistaken, the commons file-upload component can do this too. 
Am I mistaken?

Just another $.02 worth...

Brian


--
Eddie Bush




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




Re: Struts file upload validation problem

2002-11-20 Thread Brian Hickey
Martin is correct :o)

Also be aware that very very large files can exceed the setting of Java temp
space (memory) allocation is some containers and crash them.

One approach that works is to write a simple file upload script in Perl.
This allows you to check content-type, size, etc. and reject the upload
before trouble happens. It is also platform independent to a "reasonable"
degree.

Just another $.02 worth...

Brian



- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 1:16 PM
Subject: Re: Struts file upload validation problem


>
>
> On Wed, 20 Nov 2002, Poynter, Stephen wrote:
>
> > I have just written a document upload tool for a customer using the
struts
> > upload functionality.  My upload jsp consists of one form that is of
course
> > a multipart/form-data form.  The form consists of the file field along
with
> > other text fields where the user enters various information( owner,
title,
> > etc.) about the file to be uploaded.  The problem I'm having is that
once
> > you submit the form struts immediately starts uploading the file before
any
> > of the other data in the form is validated.  So, in my case, the user
tries
> > to upload a large file but enters invalid information for the other text
> > fields.  Struts then uploads the file before validating the form data.
So
> > when the user corrects their mistake they have to re-upload the file yet
> > again.  Is it possible to have the form data validated before the file
is
> > uploaded?  I would rather not use javascript for error checking.  Any
help
> > is appreciated.  Thanks...
>
> Just to clarify the process, Struts does not upload the file, the browser
> does. The file is part of the same request as the other fields in your
> form - it's one of the -parts- in the -multipart- request, as is each of
> the remaining fields. Struts can't start working on the request until it
> is complete, including the file upload.
>
> If you need to do validation before the file is uploaded, you either need
> to use JavaScript in the browser, or use a separate page for the other
> fields, so that you can validate them server-side before the file is
> uploaded from its own page.
>
> --
> Martin Cooper
>
>
> >
> > Steve
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


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




Re: Struts file upload validation problem

2002-11-20 Thread Mark Lepkowski
You could have the user enter the meta data first, and then after it's validated let 
the user choose the file to upload.
  - Original Message - 
  From: Poynter, Stephen 
  To: Struts Users Mailing List (E-mail) 
  Sent: Wednesday, November 20, 2002 12:03 PM
  Subject: Struts file upload validation problem


  I have just written a document upload tool for a customer using the struts
  upload functionality.  My upload jsp consists of one form that is of course
  a multipart/form-data form.  The form consists of the file field along with
  other text fields where the user enters various information( owner, title,
  etc.) about the file to be uploaded.  The problem I'm having is that once
  you submit the form struts immediately starts uploading the file before any
  of the other data in the form is validated.  So, in my case, the user tries
  to upload a large file but enters invalid information for the other text
  fields.  Struts then uploads the file before validating the form data.  So
  when the user corrects their mistake they have to re-upload the file yet
  again.  Is it possible to have the form data validated before the file is
  uploaded?  I would rather not use javascript for error checking.  Any help
  is appreciated.  Thanks...

  Steve


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



Re: Struts file upload validation problem

2002-11-20 Thread Martin Cooper


On Wed, 20 Nov 2002, Poynter, Stephen wrote:

> I have just written a document upload tool for a customer using the struts
> upload functionality.  My upload jsp consists of one form that is of course
> a multipart/form-data form.  The form consists of the file field along with
> other text fields where the user enters various information( owner, title,
> etc.) about the file to be uploaded.  The problem I'm having is that once
> you submit the form struts immediately starts uploading the file before any
> of the other data in the form is validated.  So, in my case, the user tries
> to upload a large file but enters invalid information for the other text
> fields.  Struts then uploads the file before validating the form data.  So
> when the user corrects their mistake they have to re-upload the file yet
> again.  Is it possible to have the form data validated before the file is
> uploaded?  I would rather not use javascript for error checking.  Any help
> is appreciated.  Thanks...

Just to clarify the process, Struts does not upload the file, the browser
does. The file is part of the same request as the other fields in your
form - it's one of the -parts- in the -multipart- request, as is each of
the remaining fields. Struts can't start working on the request until it
is complete, including the file upload.

If you need to do validation before the file is uploaded, you either need
to use JavaScript in the browser, or use a separate page for the other
fields, so that you can validate them server-side before the file is
uploaded from its own page.

--
Martin Cooper


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


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




Struts file upload validation problem

2002-11-20 Thread Poynter, Stephen
I have just written a document upload tool for a customer using the struts
upload functionality.  My upload jsp consists of one form that is of course
a multipart/form-data form.  The form consists of the file field along with
other text fields where the user enters various information( owner, title,
etc.) about the file to be uploaded.  The problem I'm having is that once
you submit the form struts immediately starts uploading the file before any
of the other data in the form is validated.  So, in my case, the user tries
to upload a large file but enters invalid information for the other text
fields.  Struts then uploads the file before validating the form data.  So
when the user corrects their mistake they have to re-upload the file yet
again.  Is it possible to have the form data validated before the file is
uploaded?  I would rather not use javascript for error checking.  Any help
is appreciated.  Thanks...

Steve


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




validation problem: limit on the number of fields allowed in a form

2002-11-19 Thread Daniel Bray (CAPE)
I have a strange problem involving the validation of fairly big forms.

First a preamble: the form itself always has the same name, but the field
that it's validating won't be known until runtime. There are 366 fields per
version and there are at least four versions.

I had tried to get around this by auto generating a big validation xml file
where each  had a unique id that could be derived at runtime: the JSP
could populate a hidden field of the same name with the value being saved,
and so validation could be done.

This worked fine when I was testing it for a handful of fields, the problem
arose when I tried to create a validation XML file with 1,464 fields.

In the rendered HTML page, I get this:

function TAPMask () {
 this.aa = new Array(.);
 this.ab = new Array(.);
  ...
 this.zy = new Array(.);
 this.zz = new Array(.);
 this.null = new Array(.); // this ain't right
 this.aa = new Array(.);
 this.ab = new Array(.);
  ...
 this.uw = new Array(.);
   }

As you can see the variable names run out at "zz" and then roll over.

What I'm asking here is:
1. Is this a recognized bug, and if so, is there any ETA on when this will
be fixed?
2. Currently I'm using the following to include the validation client-side.
<%-- Struts validation --%>


I can't change the form name for each field, or even for each field group
(there's too many) but is there any way of defining multiple validation
files for a form and then telling the validator to use a specific file.


Thanks for reading this far.



from me, daniel.










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




date validation problem

2002-10-11 Thread Nicolas Robert

Hello,


I use struts validator to check if a date that's not required has a correct
format.

It's working fine, but if the user leave the date field empty and submit the
form, Struts generate an invalide date format error.

Here's the sample of my validator.xml file :

...



...


Please, could you tell me how to inform Struts validation system that we
only want to check if the date format is correct when the date is not empty?


Thanks



Nicolas


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




RE: date validation problem

2002-10-11 Thread Peggy Davidson

It was the struts.jar from 10/5. Applying an entire nightly for me seemed to
fix that issue but then I ran into other validation problems, so I reverted
back to just the struts.jar which worked fine.

Peggy T. Davidson
TIKA Consulting, Inc.
President
Cell: 678-360-3346
Email: [EMAIL PROTECTED]

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 11, 2002 9:03 AM
To: 'Struts Users Mailing List'
Subject: RE: date validation problem

Which nightly did you bring down?  I had the same problem, brought down the
20021008 nightly, and still had the problem.  Has the patch just been
recently committed?

Jerry

> -Original Message-
> From: Peggy Davidson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 8:00 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: date validation problem
>
>
> If you search the archive you will find that  there was a
> patch applied
> shortly after the beta 2 release for the StrutsValidator
> Class. I resolved
> mine by downloading the latest struts.jar only and it fixed
> the problem just
> fine.  Or, you can download the source file and fix the
> problem and rebuild
>
> See thread:
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg
> 40614.html
>
> Peggy
>
>
> -Original Message-
> From: Nicolas Robert [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 9:02 AM
> To: 'Struts Users Mailing List' (E-mail)
> Subject: date validation problem
>
> Hello,
>
>
> I use struts validator to check if a date that's not required
> has a correct
> format.
>
> It's working fine, but if the user leave the date field empty
> and submit the
> form, Struts generate an invalide date format error.
>
> Here's the sample of my validator.xml file :
>
> ...
>  depends="date"  page="1">
> 
> 
> ...
>
>
> Please, could you tell me how to inform Struts validation
> system that we
> only want to check if the date format is correct when the
> date is not empty?
>
>
> Thanks
>
>
>
> Nicolas
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>

This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at (800)388-4675.



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



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




RE: date validation problem

2002-10-11 Thread Jerry Jalenak

Which nightly did you bring down?  I had the same problem, brought down the
20021008 nightly, and still had the problem.  Has the patch just been
recently committed?

Jerry

> -Original Message-
> From: Peggy Davidson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 8:00 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: date validation problem
> 
> 
> If you search the archive you will find that  there was a 
> patch applied
> shortly after the beta 2 release for the StrutsValidator 
> Class. I resolved
> mine by downloading the latest struts.jar only and it fixed 
> the problem just
> fine.  Or, you can download the source file and fix the 
> problem and rebuild
> 
> See thread:
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg
> 40614.html
> 
> Peggy
> 
> 
> -Original Message-
> From: Nicolas Robert [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 9:02 AM
> To: 'Struts Users Mailing List' (E-mail)
> Subject: date validation problem
> 
> Hello,
> 
> 
> I use struts validator to check if a date that's not required 
> has a correct
> format.
> 
> It's working fine, but if the user leave the date field empty 
> and submit the
> form, Struts generate an invalide date format error.
> 
> Here's the sample of my validator.xml file :
> 
> ...
>  depends="date"  page="1">
> 
> 
> ...
> 
> 
> Please, could you tell me how to inform Struts validation 
> system that we
> only want to check if the date format is correct when the 
> date is not empty?
> 
> 
> Thanks
> 
> 
> 
> Nicolas
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 

This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at (800)388-4675.



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




RE: date validation problem

2002-10-11 Thread Peggy Davidson

If you search the archive you will find that  there was a patch applied
shortly after the beta 2 release for the StrutsValidator Class. I resolved
mine by downloading the latest struts.jar only and it fixed the problem just
fine.  Or, you can download the source file and fix the problem and rebuild

See thread:
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg40614.html

Peggy


-Original Message-
From: Nicolas Robert [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 11, 2002 9:02 AM
To: 'Struts Users Mailing List' (E-mail)
Subject: date validation problem

Hello,


I use struts validator to check if a date that's not required has a correct
format.

It's working fine, but if the user leave the date field empty and submit the
form, Struts generate an invalide date format error.

Here's the sample of my validator.xml file :

...



...


Please, could you tell me how to inform Struts validation system that we
only want to check if the date format is correct when the date is not empty?


Thanks



Nicolas


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



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




Re: Form Bean Validation problem

2002-02-09 Thread Ted Husted

As Robert mentioned, the best practice is to declare all the ActionForm
properties as Strings or booleans. 

The purpose of the ActionForm is not to represent your business data. It
is to serve as a buffer for the HTML controls. HTTP is String-based, and
so the ActionForm properties need to be String-based too. Otherwise, as
you have discovered, invalid values disappear, and cannot be presented
to the user for correction. 

Once the String values have been validated, you can then transform them
to their proper type, and store them in a business bean designed for
this purpose. 

Another important function of the ActionForm is to serve as a firewall
between the Web users and the rest of your application. We have no
control over what insane values someone can toss at our actions via
HTTP. The ActionForm is a DMZ where we can accept whatever value is
tendered, but validate it before it passed along to business objects
(which tend to be more trusting). 

For more about the design of ActionForms, see also

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19338.html

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg08070.html

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/



cool dude wrote:
> 
> Hi,
>Here's a small problem that I'm facing. I have a
> form which has an integer field, say a cost of some
> item. Now, I need to do the validation for this
> form-field to make sure that the user does not enter a
> non-numeric data in this field. I have the form
> containing this field as a primitive int. The problem
> is that whenever a non-numberic value is entered the
> value is reset to zero. This leads to two problems,
> one it doesn't give me a chance to find out that the
> user has entered a non-numeric value in my validate
> method & secondly, I end up losing the value that the
> user had entered & hence can't show him the value
> back. The rather crude solution to this is to make the
> numeric form-field value a String & do the check in
> the validate() to find if a non-numeric value is
> entered. But I'm not happy with this solution as it
> requires me to decalre a field as string even when it
> should have been an int or float ...
> 
> Is there any other way around this prob?
> 
> Thanx in advance,
> VD.
> 
> __
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

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




Re: Form Bean Validation problem

2002-02-09 Thread Pavel Nejedly

On Sat, Feb 09, 2002 at 04:29:46AM -0800, cool dude wrote:
# Hi,
#Here's a small problem that I'm facing. I have a
# form which has an integer field, say a cost of some
# item. Now, I need to do the validation for this
# form-field to make sure that the user does not enter a
# non-numeric data in this field. I have the form
# containing this field as a primitive int. The problem
# is that whenever a non-numberic value is entered the
# value is reset to zero. This leads to two problems,
# one it doesn't give me a chance to find out that the
# user has entered a non-numeric value in my validate
# method & secondly, I end up losing the value that the
# user had entered & hence can't show him the value
# back. The rather crude solution to this is to make the
# numeric form-field value a String & do the check in
# the validate() to find if a non-numeric value is
# entered. But I'm not happy with this solution as it
# requires me to decalre a field as string even when it
# should have been an int or float ...

  I use two variables in the bean for the same non-String
  property, like this:

  class myForm extends ActionForm {

private String price;
private float priceAsFloat;

public String getPrice () { return this.price; } 
  /* this is called by  */
public void setPrice (String price) { this.price = price; }
  /* this is called during submit */

public float getPriceAsFloat() { return this.priceAsFloat; }
  /* this is used in Action */
/* note no settter method for priceAsFloat */

public ActionErrors validate (...) {

  ActionErrors errors = new ActionErrors ();

  /* validate () is the perfect place to convert String
   * data to int, Date or whatever else
   */
  
  try {
priceAsFloat = Float.parseFloat (price);
  } catch (Exception e) {
errors.add ("price", new ActionError("invalid.price"));
  }

  return errors;
}
  }

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




RE: Form Bean Validation problem

2002-02-09 Thread Robert Taylor

Albeit crude, I think that declaring it as a String is the right thing to
do. The value is sent across the wire as a string and Struts attempts to
convert it to the proper data type using introspection. The advantage of
declaring it as a String is that you have more granular control over
validation as you have already mentioned. Once your form has properly
validated the field, then you can safely use Integer.parseInt() in the
Action class to convert it to the expected primitive value.

My forms are usually contain all String fields. I then use an exportObject()
which returns a value object with the data in the appropriate
native format (ints, floats, Date, etc...) I can then pass the value object
to a business delegate to perform any business logic processing.
I also have an importObject() which maps and converts the value object data
members into the appropriate String fields.

That's just my preference.

robert

> -Original Message-
> From: cool dude [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 09, 2002 7:30 AM
> To: [EMAIL PROTECTED]
> Subject: Form Bean Validation problem
>
>
> Hi,
>Here's a small problem that I'm facing. I have a
> form which has an integer field, say a cost of some
> item. Now, I need to do the validation for this
> form-field to make sure that the user does not enter a
> non-numeric data in this field. I have the form
> containing this field as a primitive int. The problem
> is that whenever a non-numberic value is entered the
> value is reset to zero. This leads to two problems,
> one it doesn't give me a chance to find out that the
> user has entered a non-numeric value in my validate
> method & secondly, I end up losing the value that the
> user had entered & hence can't show him the value
> back. The rather crude solution to this is to make the
> numeric form-field value a String & do the check in
> the validate() to find if a non-numeric value is
> entered. But I'm not happy with this solution as it
> requires me to decalre a field as string even when it
> should have been an int or float ...
>
> Is there any other way around this prob?
>
> Thanx in advance,
> VD.
>
> __
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>


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




Form Bean Validation problem

2002-02-09 Thread cool dude

Hi,
   Here's a small problem that I'm facing. I have a
form which has an integer field, say a cost of some
item. Now, I need to do the validation for this
form-field to make sure that the user does not enter a
non-numeric data in this field. I have the form
containing this field as a primitive int. The problem
is that whenever a non-numberic value is entered the
value is reset to zero. This leads to two problems,
one it doesn't give me a chance to find out that the
user has entered a non-numeric value in my validate
method & secondly, I end up losing the value that the
user had entered & hence can't show him the value
back. The rather crude solution to this is to make the
numeric form-field value a String & do the check in
the validate() to find if a non-numeric value is
entered. But I'm not happy with this solution as it
requires me to decalre a field as string even when it
should have been an int or float ...

Is there any other way around this prob?

Thanx in advance,
VD.

__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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




Re: validation problem

2001-07-15 Thread Gregor Rayman

"Yuriy Zubarev" <[EMAIL PROTECTED]> wrote:


> David,
>
> Yes it is. I think that userForm exists after the validation
> process (otherwise I would have gotten an error earlier), but something is
> wrong
> with countriesList. The form is quite big so I'll post part of it.

The problem might be that your form is in the request scope and your
countries list does not get populated from the submitted data. I've
similar "problems" when I used the ActionForm for displaying read
only properties which did not have an  on the jsp page.

In request scope it works something like this:

The ActionForm instace (A1) is used to fill jour JSP. A1 has been
probably prepared by some Action. After delivering the response
(JSP) the instace A1 is forgotten and eventually garbage collected.

The teh user sumbits your JSP. New instace (A2) of your ActionForm is
created and filled with the sumbitted values. If the countries
list is neither filled in the reset() method, nor the constructor,
nor the sumbitted HTTP parameters, than it might be empty or null.

Because the instace A1 and A2 are different.

If the form is in session scope, than A1 is preserved.

--
gR




Re: validation problem

2001-07-14 Thread Yuriy Zubarev

David,

Yes it is. I think that userForm exists after the validation
process (otherwise I would have gotten an error earlier), but something is
wrong
with countriesList. The form is quite big so I'll post part of it.


...



...

...


  

...

...



Thank you for your time.

Best of luck,
Yuriy Zubarev


- Original Message -
From: "David Winterfeldt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 14, 2001 8:48 PM
Subject: Re: validation problem


> Is your bean:define inside your html:form tags?  If
> the userForm doesn't exist, you would get a null
> pointer exception trying to call it.  If this doesn't
> help, seeing the whole form might.
>
> David
>
> --- Yuriy Zubarev <[EMAIL PROTECTED]> wrote:
> > Salutation to everyne!
> >
> > I have a form (extends ActionForm) that has a
> > property "countriesList"
> > which holds a list of beans. In jsp form page I have
> > a code:
> >
> >  > property="countriesList"/>
> >
> > which is executed without problems when the page is
> > shown first time,
> > but when I click submit without entering values into
> > textboxes,
> > "valiate" method of my "UserForm" works out and
> > redirects the flaw
> > back to "user.jsp" and here I get exception. Looks
> > like "countryList"
> > property vanishes from "userForm".
> >
> >   
> > <[WebAppServletContext(2485833,haa)] action:
> > Validation error(s), redire
> > cting to: /user.jsp>
> >   
> > <[WebAppServletContext(2485833,haa)] Servlet failed
> > with Exception
> > java.lang.NullPointerException
> > at
> >
> weblogic.utils.UnsyncHashtable.put(UnsyncHashtable.java:272)
> > at
> >
>
weblogic.servlet.jsp.PageContextImpl.setAttribute(PageContextImpl.java:124)
> > at
> >
>
weblogic.servlet.jsp.PageContextImpl.setAttribute(PageContextImpl.java:149)
> > at
> >
> org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:210)
> > at
> > jsp_servlet._user._jspService(_user.java:1899)
> > at
> >
> weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> > at
> >
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:213)
> > at
> >
>
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:157)
> > at
> >
>
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:21
49)
> > at
> >
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
> > at
> >
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> > at
> >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > at
> >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:213)
> > at
> >
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1265)
> > at
> >
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1631)
> > at
> >
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
> > at
> >
> weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >
> > Any help will be highly appreciated.
> >
> > Thank you for your time.
> >
> > Best of luck,
> > Yuriy Zubarev
> >
> >
> > __
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
>
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/



Re: validation problem

2001-07-14 Thread David Winterfeldt

Is your bean:define inside your html:form tags?  If
the userForm doesn't exist, you would get a null
pointer exception trying to call it.  If this doesn't
help, seeing the whole form might.

David

--- Yuriy Zubarev <[EMAIL PROTECTED]> wrote:
> Salutation to everyne!
> 
> I have a form (extends ActionForm) that has a
> property "countriesList"
> which holds a list of beans. In jsp form page I have
> a code:
> 
>  property="countriesList"/>
> 
> which is executed without problems when the page is
> shown first time,
> but when I click submit without entering values into
> textboxes,
> "valiate" method of my "UserForm" works out and
> redirects the flaw
> back to "user.jsp" and here I get exception. Looks
> like "countryList"
> property vanishes from "userForm".
> 
>   
> <[WebAppServletContext(2485833,haa)] action:  
> Validation error(s), redire
> cting to: /user.jsp>
>   
> <[WebAppServletContext(2485833,haa)] Servlet failed
> with Exception
> java.lang.NullPointerException
> at
>
weblogic.utils.UnsyncHashtable.put(UnsyncHashtable.java:272)
> at
>
weblogic.servlet.jsp.PageContextImpl.setAttribute(PageContextImpl.java:124)
> at
>
weblogic.servlet.jsp.PageContextImpl.setAttribute(PageContextImpl.java:149)
> at
>
org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:210)
> at
> jsp_servlet._user._jspService(_user.java:1899)
> at
>
weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
> at
>
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:157)
> at
>
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2149)
> at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
> at
>
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1265)
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1631)
> at
>
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
> at
>
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> 
> Any help will be highly appreciated.
> 
> Thank you for your time.
> 
> Best of luck,
> Yuriy Zubarev
> 
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



validation problem

2001-07-14 Thread Yuriy Zubarev

Salutation to everyne!

I have a form (extends ActionForm) that has a property "countriesList"
which holds a list of beans. In jsp form page I have a code:



which is executed without problems when the page is shown first time,
but when I click submit without entering values into textboxes,
"valiate" method of my "UserForm" works out and redirects the flaw
back to "user.jsp" and here I get exception. Looks like "countryList"
property vanishes from "userForm".

  
<[WebAppServletContext(2485833,haa)] action:   Validation error(s), redire
cting to: /user.jsp>
  
<[WebAppServletContext(2485833,haa)] Servlet failed with Exception
java.lang.NullPointerException
at weblogic.utils.UnsyncHashtable.put(UnsyncHashtable.java:272)
at
weblogic.servlet.jsp.PageContextImpl.setAttribute(PageContextImpl.java:124)
at
weblogic.servlet.jsp.PageContextImpl.setAttribute(PageContextImpl.java:149)
at
org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:210)
at jsp_servlet._user._jspService(_user.java:1899)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:157)
at
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2149)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1265)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1631)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Any help will be highly appreciated.

Thank you for your time.

Best of luck,
Yuriy Zubarev


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/