validate="true" just means that the validate(mapping,req) method will
be called and forwarded back to the inputForward before you get to the
action. But as you call it in the action this shouldn't matter..

Are things going wrong in the validate method (i.e. does errors.size()
return zero even when its an invalid usecase) or is the problem
between saveErrors(..) and the jsp?

Sorry I have no idea what's wrong either, but might help to know which
part isn't working..

Mark

On 3/22/06, Thibaut <[EMAIL PROTECTED]> wrote:
> Thank you for your quick reply !
> I really don't know what is the difference between what i do and the
> "struts-mailreader" exemple !!!!
>
> I already did what you write here. In fact it was the first think i did.
> I have this problem for *all my actions* in my app.
>
> So the code is :
>
>
>     <action    path="/insertANewCandidate"
>
> type="com.cvdunet.controller.action.UpdateResponsesForRequestAction"
>                input="missions_copyMailToBasket.jsp"
>                name="candidateForm"
>                scope="request"
>                validate="true">
>        <forward name="success_from_tool" path="/close.jsp"/>
>        <forward name="success" path="/mycv.jsp"/>
>     </action>
> ...
>   <controller pagePattern="$M$P" maxFileSize="2M" inputForward="true" />
>   <message-resources
> parameter="com.cvdunet.controller.ApplicationResources"/>
>
>
> In the bean :
>
>      public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest request)
>      {
>          ActionErrors errors  = new ActionErrors();
>          ActionMessage error = new
> ActionMessage("com.cvdunet.response.NOBASKETSELECTED");
>          errors.add(ActionMessages.GLOBAL_MESSAGE, error);
>           return errors;
>     }
>
>
> In the ApplicationResources.properties
>
> com.cvdunet.response.NOBASKETSELECTED = No basket selected
>
>
> In the missions_copyMailToBasket.jsp :
>
> ...
> <html:errors/>
> ...
>
>
>
>
>
>
> What's wrong ?
>
>
>
> [EMAIL PROTECTED] a écrit :
>
> >Hi
> >
> >Howecome you have validate="false"? If you want validation, then set it to 
> >true
> >
> >
> >-----Original Message-----
> >From: Thibaut [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, March 22, 2006 11:41 AM
> >To: user@struts.apache.org
> >Subject: Validation Problem
> >
> >
> >Hi
> >
> >I have all the time the same problem and there is a week i try to solve
> >it. It should be trivial but i can't see.
> >None of my validation work !
> >I now use Struts 1.2.8 with module. The application use to work with
> >Struts 1.0.
> >
> >In the Struts-config.xml of the "user" module :
> >
> >    <action    path="/insertANewCandidate"
> >
> >type="com.cvdunet.controller.action.UpdateResponsesForRequestAction"
> >               input="missions_copyMailToBasket.jsp"
> >               name="candidateForm"
> >               scope="request"
> >               validate="false">
> >       <forward name="success_from_tool" path="/close.jsp"/>
> >       <forward name="success" path="/mycv.jsp"/>
> >    </action>
> >...
> >
> >  <controller pagePattern="$M$P" maxFileSize="2M" inputForward="true" />
> >  <message-resources
> >parameter="com.cvdunet.controller.ApplicationResources"/>
> >
> >
> >
> >In the action :
> >
> >        CandidateForm candidateForm = (CandidateForm) form;
> >            ActionMessages errors = candidateForm.validate();
> >            if (!errors.isEmpty()) {
> >                this.saveErrors(request, errors);
> >                return mapping.getInputForward();
> >            }
> >
> >
> >
> >And in the form :
> >
> >     public ActionMessages validate()
> >     {
> >             ActionMessages errors  = new ActionMessages();
> >             ActionMessage error = new
> >ActionMessage(CandidateConstant.NO_BASKET);
> >             errors.add(ActionMessages.GLOBAL_MESSAGE, error);
> >             return errors;
> >    }
> >
> >
> >Can anyone help ?
> >Thank you
> >
> >--
> >Thibaut Lassalle
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to