struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gokul balasubramanian" <gokulb...@rediffmail.com>
Subject Re: Re: Validate() method not working as it should !!!!!
Date Wed, 05 Apr 2006 16:34:53 GMT
  
Thanks for the replies guys, I am validating the form in the form-bean's validate method.
The form-bean code is given below:-

public class ImageForm extends ActionFormBase
{
// getter and setter methods

  public ActionErrors validate( ActionMapping mapping,
      HttpServletRequest request )
  {
    // TODO Auto-generated method stub
	   ActionErrors errors = new ActionErrors();
   
	   //checking if null values exist, if yes then throw an error to the user
	   

	  if(sizeTiles==null || sizeTiles.length()<1)
	  {
		  errors.add("porttilessize", new ActionError("error.tilePort.required"));
	  }
   
    return errors;
	  
  }


On Wed, 05 Apr 2006 Dave Newton wrote :
>Gary Feidt wrote:
> > Where is your Validation?  I don't see any protected ActionMessages
> > validate(iForm theform) {}
> >
>
>Also, what class does your form sub-class?
>
> > error = validate(theform);
> >
>
>He has validate="true" which, if the form has a proper superclass,
>should do validation automagically, no?
>
> >     if ( "view".equalsIgnoreCase( action ) ) [...]
> >
>
>*shudder*
>
>Dave
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message