I think the behaviour is exactly as expected: 
If the field is wqh, then procedure validate returns a not empty
ActionError and therefore you get redirected to the page specified by
input within your action-mapping (normally the same page from where you
submit your form).

If the field is "wqh" the validate returns NULL; should be the same
effect like returning an empty ActionError (what imo is the better
solution: defining an ActionError in the first line of the validate
method and returning it with the return-statement - no matter if it's
empty or not):
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?

Fabian

> -----Original Message-----
> From: wu qihua [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 29, 2002 11:16 AM
> To: [EMAIL PROTECTED]
> 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-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:struts-user-
> [EMAIL PROTECTED]>


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

Reply via email to