struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "wu qihua" <wqh_...@hotmail.com>
Subject RE: when the validate retrun null,then the excute in action will not call?
Date Thu, 29 Aug 2002 11:24:23 GMT

>The execute-method is entered and the result is a system-output:
>"begin to process" as the execute is started. The field is still not
>equal to wqh (it would have been invalidate otherwise!), so next output
>is "not equal". So of course the execute is called!
>
>Where is your problem with this behaviour?

   But when I populate the field with string wqh1, there is no message show 
in the console,if execute function is called,it must print
          begin to process

but really it does not!
>
>Fabian
>
> > -----Original Message-----
> > From: wu qihua [mailto:wqh_hlp@hotmail.com]
> > Sent: Thursday, August 29, 2002 11:16 AM
> > To: struts-user@jakarta.apache.org
> > Subject: when the validate retrun null,then the excute in action will
>not
> > call?
> >
> >     when the field is wqh ,there isn't any  message print in the
> > console,but
> > if the field is "wqh",then it will print
> >          begin to process
> >          not equal
> >
> > and if the excute run ,print the sentence "begin to process" is a
>must,but
> > really it did not,that means the function of excute never run when
> > validate
> > return null,
> > if I want it to run ,and do not add any error message,what should it
> > return?
> >
> >
> > public ActionErrors validate(
> > 		ActionMapping mapping,
> > 		HttpServletRequest request) {
> > 		if (nam.equals("wqh")){
> > 			ActionErrors err=new ActionErrors();
> > 			err.add("error",new ActionError("first"));
> > 			return err;
> > 		}
> > 		return null;
> > 	}
> >
> > public ActionForward execute(..)
> > 		throws Exception {
> > 		LongonForm longonForm = (LongonForm) form;
> >   ///////////*********  this print sentence must run if the excute is
> > called
> >   **/
> > 		System.out.println(" begin to process";
> > 		if (longonForm.getNam().equals("wqh")){
> > 			System.out.println("equal to wqh");
> >      		throw new UnsupportedOperationException("Easy Struts :
>i);
> > 		}
> >      	else {
> >            System.out.println("not equal");
> >      	   return (mapping.getInputForward());
> >      	}
> > 	}
> >
> >
> >
> > _________________________________________________________________
> > Chat with friends online, try MSN Messenger: http://messenger.msn.com
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:struts-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:struts-user-
> > help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@jakarta.apache.org>




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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


Mime
View raw message