If

* the class extends one of the ActionForm base classes, and
* the class overrides the base validate method, and
* the class is registered as the form bean for the action, and
* the validate methods returns a non-null and non-empty ActionErrors
collection,

then the input location should be selected before the Action ever executes.

If it's not working, then one of the conditions must be false.

The next thing I would try would be to hardware an non-null, non-empty
ActionError return, so as to eliminate a variable.

HTH, Ted.


On 5 Apr 2006 16:54:19 -0000, gokul  balasubramanian
<[EMAIL PROTECTED]> wrote:
>
> all i am trying to do is perform basic form validation. but that itself 
> doesnt seem to work. i have other actions which work fine except this one. 
> what happens is that it finds errors and indicates the errors in the forward 
> "success" page instead of the "input" page. sorry for repeating myself folks. 
> i'm just trying to get the message across thats all. This has proved a real 
> toughie ......
>
> hoping for a speedy reply/solution
>
> Cheers
> G
>
> On Wed, 05 Apr 2006 gokul  balasubramanian wrote :
> >
> >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: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
>
>
>
>


--
HTH, Ted.
** http://www.husted.com/ted/blog/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to