You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thibaut <la...@ifrance.com> on 2006/03/22 11:41:11 UTC
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Validation Problem
Posted by Thibaut <la...@ifrance.com>.
Hi
i found the solution i was looking for :
http://wiki.apache.org/struts/StrutsDeprecatedActionErrors
Thank you for those who tried to help me.
Thibaut Lassalle
Thibaut a écrit :
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org