J
Jack
Hello,
I'm currently having a problem with the Struts validator.
I have a very simple Struts bean "EditionPersonneForm" (extending
ValidatorForm) associated with an action "EditerPersonneAction" and a
JSP form "EditerPersonne.jsp"
[From struts-config.xml]
<action path="/EditionPersonne"
type="com.myproject.actions.EditerPersonneAction"
scope="session" name="EditerPersonneForm"
input="/pages/EditerPersonne.jsp"
parameter="do"
validate="true">
<forward name="afficherEditionPersonne"
path="/pages/EditionPersonne.jsp"/>
<forward name="afficherAjoutPersonne"
path="/pages/AjoutPersonne.jsp" />
</action>
[end of listing]
The matter is that the method validate() is called BEFORE the form is
displayed. So if the Struts bean is filled in with wrong values at this
very moment, the validator causes an error and Struts redirects me to
the "input" error page, and the action (which populates the form
with the right data) is never called !
I have another quite alike project where the validate is not called
before the JSP (to me it should be the normal behaviour), so I guess
this is a simple problem of configuration, but I just was not able to
find it.
Does anyone have a clue ?
Thanks in advance,
Olivier
I'm currently having a problem with the Struts validator.
I have a very simple Struts bean "EditionPersonneForm" (extending
ValidatorForm) associated with an action "EditerPersonneAction" and a
JSP form "EditerPersonne.jsp"
[From struts-config.xml]
<action path="/EditionPersonne"
type="com.myproject.actions.EditerPersonneAction"
scope="session" name="EditerPersonneForm"
input="/pages/EditerPersonne.jsp"
parameter="do"
validate="true">
<forward name="afficherEditionPersonne"
path="/pages/EditionPersonne.jsp"/>
<forward name="afficherAjoutPersonne"
path="/pages/AjoutPersonne.jsp" />
</action>
[end of listing]
The matter is that the method validate() is called BEFORE the form is
displayed. So if the Struts bean is filled in with wrong values at this
very moment, the validator causes an error and Struts redirects me to
the "input" error page, and the action (which populates the form
with the right data) is never called !
I have another quite alike project where the validate is not called
before the JSP (to me it should be the normal behaviour), so I guess
this is a simple problem of configuration, but I just was not able to
find it.
Does anyone have a clue ?
Thanks in advance,
Olivier