You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GR...@intellicare.com on 2005/08/10 20:55:50 UTC
Re: {Spam?} RE: validate() not called haunts
That's right!!! I mean about the method signature!! I meant to write that
to you and then something else intervened and i forgot.. Yes, so do that
and let us know..:)
Geeta
"Duane Rosengartner" <DR...@excentus.com> wrote on 08/10/2005
02:51:42 PM:
> >> p. Now i have got the debugging working. But
> Since debugging is working, try catching a breakpoint where validate is
> being called, then step-into...
> My best guess is the method signatures need to be verified. INO, are you
> overridding validate or overloading? You may be invoking the superclass
> validate instead of the intended forms' validate. If all else fails,
> place a breakpoint/sys.out in Struts' ActionForm.validate to see if it's
> getting there.
>
> Happy debugging,
> Duane
>
> -----Original Message-----
> From: Jay Sheth [mailto:shethju@gmail.com]
> Sent: Wednesday, August 10, 2005 9:23 AM
> To: Struts Users Mailing List
> Subject: validate() not called haunts
>
> Hi,
> Thanks for all the help. Now i have got the debugging working. But still
> the problem remains, validate() not being called. I tried all
> combinations...I made a simple action and form without any business
> logic etc...but i dont understand why validate method is being called in
> only a single form and not being called for any other forms.
>
> Most weird error.
>
> Even if I call validate from the corresponding action, it does not get
> called. However if I rename the validate method by another method e..g
> update then I can call the update method from action.
>
> Is there a way that the action errors created can be shown as error by
> jsp page ?
>
> Heres the code ;
> **action
> form.update(mapping,request); // form.validate() doesnt get called so i
> renamed
> to update()
>
> **form
> public ActionErrors update(ActionMapping mapping, ServletRequest
> request) {
> super.validate(mapping,servlet);
> errors = new ActionErrors();
> if (nullOrBlank(m_location)) {
> errors.add("Location",new
> ActionError("errors.location.required"));
> }
> return new ActionErrors();
> }
>
> So basically the action class can get the errors, but how should i
> display that errors on jsp (This is all because validate() not being
> called).
>
> Jay
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> CONFIDENTIALITY NOTICE:This email is intended solely for the person
> or entity to which it is addressed and may contain confidential
> and/or protected health information. Any duplication,
> dissemination, action taken in reliance upon, or other use of this
> information by persons or entities other than the intended recipient
> is prohibited and may violate applicable laws. If this email has
> been received in error, please notify the sender and delete the
> information from your system. The views expressed in this email are
> those of the sender and may not necessarily represent the views of
> IntelliCare.
RE: validate() not called haunts
Posted by Jay Sheth <sh...@gmail.com>.
well,
I have given up on calling the validate(), I have checked method sign etc...
now i am renaming the validate to another method name e.g.
validate_fields. I am calling the validate_fields from action. and
using addErrors in action to add messages to jsp.
Thanks,
Jay
On 8/10/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> That's right!!! I mean about the method signature!! I meant to write that
> to you and then something else intervened and i forgot.. Yes, so do that
> and let us know..:)
>
> Geeta
>
> "Duane Rosengartner" <DR...@excentus.com> wrote on 08/10/2005
> 02:51:42 PM:
>
> > >> p. Now i have got the debugging working. But
> > Since debugging is working, try catching a breakpoint where validate is
> > being called, then step-into...
> > My best guess is the method signatures need to be verified. INO, are you
> > overridding validate or overloading? You may be invoking the superclass
> > validate instead of the intended forms' validate. If all else fails,
> > place a breakpoint/sys.out in Struts' ActionForm.validate to see if it's
> > getting there.
> >
> > Happy debugging,
> > Duane
> >
> > -----Original Message-----
> > From: Jay Sheth [mailto:shethju@gmail.com]
> > Sent: Wednesday, August 10, 2005 9:23 AM
> > To: Struts Users Mailing List
> > Subject: validate() not called haunts
> >
> > Hi,
> > Thanks for all the help. Now i have got the debugging working. But still
> > the problem remains, validate() not being called. I tried all
> > combinations...I made a simple action and form without any business
> > logic etc...but i dont understand why validate method is being called in
> > only a single form and not being called for any other forms.
> >
> > Most weird error.
> >
> > Even if I call validate from the corresponding action, it does not get
> > called. However if I rename the validate method by another method e..g
> > update then I can call the update method from action.
> >
> > Is there a way that the action errors created can be shown as error by
> > jsp page ?
> >
> > Heres the code ;
> > **action
> > form.update(mapping,request); // form.validate() doesnt get called so i
> > renamed
> > to update()
> >
> > **form
> > public ActionErrors update(ActionMapping mapping, ServletRequest
> > request) {
> > super.validate(mapping,servlet);
> > errors = new ActionErrors();
> > if (nullOrBlank(m_location)) {
> > errors.add("Location",new
> > ActionError("errors.location.required"));
> > }
> > return new ActionErrors();
> > }
> >
> > So basically the action class can get the errors, but how should i
> > display that errors on jsp (This is all because validate() not being
> > called).
> >
> > Jay
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> >
>
> >
> > CONFIDENTIALITY NOTICE:This email is intended solely for the person
> > or entity to which it is addressed and may contain confidential
> > and/or protected health information. Any duplication,
> > dissemination, action taken in reliance upon, or other use of this
> > information by persons or entities other than the intended recipient
> > is prohibited and may violate applicable laws. If this email has
> > been received in error, please notify the sender and delete the
> > information from your system. The views expressed in this email are
> > those of the sender and may not necessarily represent the views of
> > IntelliCare.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org