You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jay Sheth <sh...@gmail.com> on 2005/08/10 16:22:52 UTC

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

On 8/9/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> oh ok I see where you are coming from.. I didn't know about this remote
> debugging thing so it's good info..:) However, I didn't think the original
> poster had this situation at all.. or maybe i grossly
> misunderstood...(been known to happen..;))
> 
> 
> 
> 
> Ed Griebel <ed...@gmail.com>
> 08/09/2005 01:43 PM
> Please respond to
> "Struts Users Mailing List" <us...@struts.apache.org>
> 
> 
> To
> Struts Users Mailing List <us...@struts.apache.org>
> cc
> 
> Subject
> {Spam?} Re: {Spam?} Re: {Spam?} Re: {Spam?} Re: {Spam?} validate() not
> called
> 
> 
> 
> 
> 
> 
> No, not at all, it doesn't matter where tomcat is started from. As
> long as tomcat was started with JDWP debugging, you can connect up
> with any recent java debugger. Your tomcat can be in China and your
> debugging session in NYC, it just doesn't matter, and it certainly
> doesn't have to be in the same JVM.
> 
> Try googling for JDWP and/or JPDA, or see
> http://java.sun.com/products/jpda/ or
> http://jakarta.apache.org/tomcat/faq/development.html
> 
> -ed
> 
> On 8/9/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> > Well, not only that, if you want eclipse to play nice with tomcat (and
> > have eclipse obey break points and what not), then you in fact start
> > tomcat from within eclipse, right? I have been doing this for a while
> now
> > so I don't see what the problem could be..?
> >
> > Would something like this link help:
> >
> http://plato.acadiau.ca/courses/comp/dsilver/2513/EclipseAndTomcatTutorial/
> 
> >
> > Geeta
> >
> >
> 
> ---------------------------------------------------------------------
> 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


validate() finally called !!!!!!!

Posted by Jay Sheth <sh...@gmail.com>.
Hi,
Thanks for all the help. Any1 wont believe what a silly mistake. I
forgot to add the <html:errors /> tag in the jsp page.

I found out by when reading doc for the addErrors().

Thanks once again.

Jay

On 8/10/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> Gareth Evans <ga...@msoft.co.uk> wrote on 08/10/2005 10:28:31 AM:
> 
> > You could manually set the errors in the page within your action
> > with the method
> >
> > addErrors( request , form.update(mapping,request) );
> >
> > the addErrors method is already defined in the class Action.
> 
> It is saveErrors(request,..etc. isn't it?
> Also, I think you're supposed to ActionMessages instead of ActionErrors..
> 
> Geeta
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Re: Re: validate() not called haunts

Posted by Kjersti Berg <kj...@gmail.com>.
On 11/08/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> Re. the "Spam" thing, i really do apologize. I totally understand because
> it probably bugs me more than it bugs anybody else. We are supposed to use
> Lotus notes for mail in our company and I absolutely *hate* it. This
> "spam" thing is just one more annoying "feature". I guess I can look into
> it, but I have a feeling I'll get nowhere.. Only thing I can do is
> remember to manually remove it from the subject every time I write, or
> just use another mail client. But that's another can of worms...
> 

You have my sympathies. I'm also stuck with Lotus Notes at work. I
solved it by getting a gmail account for mailing lists.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Re: Re: validate() not called haunts

Posted by GR...@intellicare.com.
That was a good link - thanks! 

Re. the "Spam" thing, i really do apologize. I totally understand because 
it probably bugs me more than it bugs anybody else. We are supposed to use 
Lotus notes for mail in our company and I absolutely *hate* it. This 
"spam" thing is just one more annoying "feature". I guess I can look into 
it, but I have a feeling I'll get nowhere.. Only thing I can do is 
remember to manually remove it from the subject every time I write, or 
just use another mail client. But that's another can of worms... 

Sorry about the rant, but it's a sore point with me. I'll look into it 
tomorrow..

Geeta

Jeff Beal <jb...@gmail.com> wrote on 08/10/2005 04:04:45 PM:

> addErrors() is a new method in 1.2.7.  addErrors() and addMessages()
> are both valid, and both accept ActionMessages as arguments.  For more
> on the difference between ActionErrors and ActionMessages, see
> http://wiki.apache.org/struts/ActionErrorsAndActionMessages.  Also,
> please get rid of the 'Re: {Spam?}' in your subject lines.  It's
> annoying in general, but also causes GMail to think you are starting a
> new "Conversation".  I imagine that other mail readers have similar
> issues.
> 
> -- Jeff
> 
> On 8/10/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> > Gareth Evans <ga...@msoft.co.uk> wrote on 08/10/2005 10:28:31 
AM:
> > 
> > > You could manually set the errors in the page within your action
> > > with the method
> > >
> > > addErrors( request , form.update(mapping,request) );
> > >
> > > the addErrors method is already defined in the class Action.
> > 
> > It is saveErrors(request,..etc. isn't it?
> > Also, I think you're supposed to ActionMessages instead of 
ActionErrors..
> > 
> > Geeta
> > 
> >
> 
> ---------------------------------------------------------------------
> 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: {Spam?} Re: validate() not called haunts

Posted by Jeff Beal <jb...@gmail.com>.
addErrors() is a new method in 1.2.7.  addErrors() and addMessages()
are both valid, and both accept ActionMessages as arguments.  For more
on the difference between ActionErrors and ActionMessages, see
http://wiki.apache.org/struts/ActionErrorsAndActionMessages.  Also,
please get rid of the 'Re: {Spam?}' in your subject lines.  It's
annoying in general, but also causes GMail to think you are starting a
new "Conversation".  I imagine that other mail readers have similar
issues.

-- Jeff

On 8/10/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> Gareth Evans <ga...@msoft.co.uk> wrote on 08/10/2005 10:28:31 AM:
> 
> > You could manually set the errors in the page within your action
> > with the method
> >
> > addErrors( request , form.update(mapping,request) );
> >
> > the addErrors method is already defined in the class Action.
> 
> It is saveErrors(request,..etc. isn't it?
> Also, I think you're supposed to ActionMessages instead of ActionErrors..
> 
> Geeta
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: {Spam?} Re: validate() not called haunts

Posted by GR...@intellicare.com.
Gareth Evans <ga...@msoft.co.uk> wrote on 08/10/2005 10:28:31 AM:

> You could manually set the errors in the page within your action 
> with the method
> 
> addErrors( request , form.update(mapping,request) );
> 
> the addErrors method is already defined in the class Action.

It is saveErrors(request,..etc. isn't it?
Also, I think you're supposed to ActionMessages instead of ActionErrors..

Geeta

Re: validate() not called haunts

Posted by Gareth Evans <ga...@msoft.co.uk>.
You could manually set the errors in the page within your action with the method

addErrors( request , form.update(mapping,request) );

the addErrors method is already defined in the class Action.

Jay Sheth wrote:

> 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
> 
> On 8/9/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
> 
>>oh ok I see where you are coming from.. I didn't know about this remote
>>debugging thing so it's good info..:) However, I didn't think the original
>>poster had this situation at all.. or maybe i grossly
>>misunderstood...(been known to happen..;))
>>
>>
>>
>>
>>Ed Griebel <ed...@gmail.com>
>>08/09/2005 01:43 PM
>>Please respond to
>>"Struts Users Mailing List" <us...@struts.apache.org>
>>
>>
>>To
>>Struts Users Mailing List <us...@struts.apache.org>
>>cc
>>
>>Subject
>>{Spam?} Re: {Spam?} Re: {Spam?} Re: {Spam?} Re: {Spam?} validate() not
>>called
>>
>>
>>
>>
>>
>>
>>No, not at all, it doesn't matter where tomcat is started from. As
>>long as tomcat was started with JDWP debugging, you can connect up
>>with any recent java debugger. Your tomcat can be in China and your
>>debugging session in NYC, it just doesn't matter, and it certainly
>>doesn't have to be in the same JVM.
>>
>>Try googling for JDWP and/or JPDA, or see
>>http://java.sun.com/products/jpda/ or
>>http://jakarta.apache.org/tomcat/faq/development.html
>>
>>-ed
>>
>>On 8/9/05, GRamani@intellicare.com <GR...@intellicare.com> wrote:
>>
>>>Well, not only that, if you want eclipse to play nice with tomcat (and
>>>have eclipse obey break points and what not), then you in fact start
>>>tomcat from within eclipse, right? I have been doing this for a while
>>
>>now
>>
>>>so I don't see what the problem could be..?
>>>
>>>Would something like this link help:
>>>
>>
>>http://plato.acadiau.ca/courses/comp/dsilver/2513/EclipseAndTomcatTutorial/
>>
>>
>>>Geeta
>>>
>>>
>>
>>---------------------------------------------------------------------
>>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
> 

-- 
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

-- 
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org