RE: ClassCastException coming from DynaValidatorForm.validate()- bug or a feature?

2003-12-21 Thread Steve Armstrong
Hi,

Validator has support for validating multi-page forms via the use of an
optional page attribute, associated with a field element, that can be set
to an integer.  From the Validator portion of the user guide:

All validation for any field on a page less than or equal to the current
page is performed server side. All validation for any field on a page equal
to the current page is generated for the client side Javascript. A
multi-part form expects the page attribute to be set

html:hidden property=page value=1/

Since your form already defines a page property, and a non-integer one at
that, I can see how things might get screwed up.

Cheers,
-Steve

-Original Message-
From: Janice [mailto:[EMAIL PROTECTED]
Sent: Friday, December 19, 2003 2:25 PM
To: [EMAIL PROTECTED]
Subject: re: ClassCastException coming from
DynaValidatorForm.validate()- bug or a feature?


I went to the source to try to find out what was causing this problem, and I
started to suspect that:

form-property name=page
  type=java.lang.String
  initial=home /

was the problem... sure enough, when I changed the name to thePage,
instead of page, it worked.

Would this be a bug or just a feature that I missed the documentation for?

Janice


-
To unsubscribe, 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: ClassCastException coming from DynaValidatorForm.validate()- bug or a feature?

2003-12-19 Thread Janice
I went to the source to try to find out what was causing this problem, and I
started to suspect that:

form-property name=page
  type=java.lang.String
  initial=home /

was the problem... sure enough, when I changed the name to thePage,
instead of page, it worked.

Would this be a bug or just a feature that I missed the documentation for?

Janice


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



ClassCastException coming from DynaValidatorForm.validate()

2003-12-18 Thread Janice
Hello all,

I did have validation, etc, working in another application, but now I'm
starting a new application and I'm getting an error that I can't explain.

When I submit my form, I call:
ActionErrors errors = form.validate(mapping, request);

which spits up this error:
** error stuff starts here **
java.lang.ClassCastException: java.lang.String

org.apache.struts.action.ActionErrors
org.apache.struts.validator.DynaValidatorForm.validate(org.apache.struts.act
ion.ActionMapping, javax.servlet.http.HttpServletRequest)

DynaValidatorForm.java:141

org.apache.struts.action.ActionForward
ca.bc.gov.srm.bart.actions.AnnouncementActions.submitForm(org.apache.struts.
action.ActionMapping, org.apache.struts.action.ActionForm,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)

AnnouncementActions.java:137

java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object[])

native code
** error stuff ends here, well, there's lots more of that, but you probably
don't need to see the whole thing... **

All of my .jars and .tlds and .dtds are from the 1.1 release of Struts.  I
am using jDeveloper, but I was with the other application as well.

I think my validation.xml and validator-rules.xml are being read, since if I
put a typo in either one, the typo gets caught.

This is my form definition:
form-bean name=announcementForm
   type=org.apache.struts.validator.DynaValidatorForm 
   form-property name=id type=java.lang.String /
   form-property name=page type=java.lang.String /
   form-property name=type type=java.lang.String /
   form-property name=heading type=java.lang.String /
   form-property name=desc type=java.lang.String /
   form-property name=expiry type=java.lang.String /
   form-property name=sequence type=java.lang.String /
/form-bean

I can remove everything from my validation.xml file that pertains to this
form (its the first one), and the error still happens, so I don't think its
got anything to do with my code in there.

I would really, really appreciate some insight into this problem!
Janice

ps: Seasons' Greetings!


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