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
html:cancel value=Cancel /
While this one does
html:cancel property=mycancelbutton value=Cancel /
The only difference is
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
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.
html:cancel onclick=bCancel=true;
If you're not
hi kelly,
did you integrate it into
struts-config?
--
plug-in
className=org.apache.struts.validator.ValidatorPlugIn
set-property
property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/
/plug-in
greetings
Yes I did. It is exactly like your application.
Matthias Wessendorf wrote:
hi kelly,
did you integrate it into
struts-config?
--
plug-in
className=org.apache.struts.validator.ValidatorPlugIn
set-property
property=pathnames
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
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?
--
plug-in
className=org.apache.struts.validator.ValidatorPlugIn
set
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
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: 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
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
, 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
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
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
Well, this is what I inherited:
formname=/public/EventRegistration
fieldpage=1 property=registrant.firstname
depends=required,mask,minlength,maxlength
arg0 key=eForm.firstname/
arg1 name=minlength
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:
formname=/public/EventRegistration
fieldpage=1 property=registrant.firstname
I believe the form name must be the same as what you defined in
struts-config.xml. Try
form name=eventRegistrationForm in your validation rules.
David
Well, this is what I inherited:
formname=/public/EventRegistration
fieldpage=1 property=registrant.firstname
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,
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
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
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
Why don't you use html:text?
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:
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
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
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
html:errors property=something/ to get that SPECIFIC error. If you
switch to ActionErrors.GLOBAL_ERROR it will display all of them
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
html:errors property=something/ to get that SPECIFIC error
: 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
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
Did the logic:notPresent 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
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 logic:notPresent tag cause your app to complain about not having
the resources
]
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
,
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
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
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
34 matches
Mail list logo