You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marc Ellison <ME...@pangaeainc.com> on 2001/03/21 00:17:56 UTC

the errors tag

Hi,

Am trying out the errors tag but to no avail...I have the following code in
my validate() method of my relevant Form class...

public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
	ActionErrors errors = new ActionErrors();
  	//if (phn == null)
     	 errors.add("phn",         new ActionError("phn can't be null"));
}

...and then have the <html:errors/> tag in my jsp. However when I process
the request having left the "phn" field empty, nothing pops up on my jsp
page. Am i missing something vital here. I have followed the docs and API to
no avail!

Thanks

Marc
  


Re: the errors tag

Posted by David Winterfeldt <dw...@yahoo.com>.
Have you set validate to true in you
struts-config.xml?

<action    path="/registration"
               type="RegistrationAction"
               name="registrationForm"
               scope="request"
               validate="true"
               input="/registration.jsp">
   <forward name="success"               
            path="/index.jsp"/>
</action>

David

--- Marc Ellison <ME...@pangaeainc.com> wrote:
> Hi,
> 
> Am trying out the errors tag but to no avail...I
> have the following code in
> my validate() method of my relevant Form class...
> 
> public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest
> request) {
> 	ActionErrors errors = new ActionErrors();
>   	//if (phn == null)
>      	 errors.add("phn",         new
> ActionError("phn can't be null"));
> }
> 
> ...and then have the <html:errors/> tag in my jsp.
> However when I process
> the request having left the "phn" field empty,
> nothing pops up on my jsp
> page. Am i missing something vital here. I have
> followed the docs and API to
> no avail!
> 
> Thanks
> 
> Marc
>   
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/