Struts validation problem
843838Jan 23 2006 — edited Feb 9 2006Hello,
I am trying to use the server side struts validation. When the validation detects a validation error, a blank page is displayed instead of the input jsp.
The struts version used is 1.2.4.
Can some one please help me ?
Thanks in advance,
Pierre Laroche
My struts-config.xml file (problem is with /stepAction with input = /step.jsp):
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<!-- ========== Data Source Configuration =============================== -->
<data-sources/>
<!-- ========== Form Bean Definitions ================================== -->
<form-beans>
<form-bean name="MainForm" type="com.bnpparibas.bfi.ttk.web.form.MainForm">
</form-bean>
<form-bean name="BatchForm" type="com.bnpparibas.bfi.ttk.web.form.BatchForm">
</form-bean>
<form-bean name="ParametersForm" type="com.bnpparibas.bfi.ttk.web.form.ParametersForm">
</form-bean>
<form-bean name="StepForm" type="com.bnpparibas.bfi.ttk.web.form.StepForm">
</form-bean>
</form-beans>
<!-- ========== Global Exception Definitions ============================== -->
<global-exceptions/>
<!-- ========== Global Forward Definitions =============================== -->
<global-forwards>
<forward name="main" path="/main.jsp"/>
<forward name="batch" path="/batch.jsp"/>
<forward name="initBatch" path="/initBatchAction.do"/>
<forward name="initParameters" path="/initParametersAction.do"/>
<forward name="initStep" path="/initStepAction.do"/>
<forward name="parameters" path="/parameters.jsp"/>
<forward name="step" path="/step.jsp"/>
</global-forwards>
<!-- ========== Action Mapping Definitions =============================== -->
<action-mappings>
<action path="/mainAction"
type="com.bnpparibas.bfi.ttk.web.action.MainAction"
name="MainForm"
scope="session"
validate="true"
input="/main.jsp">
</action>
<action path="/initBatchAction"
type="com.bnpparibas.bfi.ttk.web.action.InitBatchAction"
name="BatchForm"
scope="session"
validate="false">
<forward name="success" path="/batch.jsp"/>
</action>
<action path="/batchAction"
type="com.bnpparibas.bfi.ttk.web.action.BatchAction"
name="BatchForm"
scope="session"
validate="true"
input="/batch.jsp">
</action>
<action path="/initParametersAction"
type="com.bnpparibas.bfi.ttk.web.action.InitParametersAction"
name="ParametersForm"
scope="session"
validate="false">
<forward name="success" path="/parameters.jsp"/>
</action>
<action path="/parametersAction"
type="com.bnpparibas.bfi.ttk.web.action.ParametersAction"
name="ParametersForm"
scope="session"
validate="true"
input="/parameters.jsp">
</action>
<action path="/initStepAction"
type="com.bnpparibas.bfi.ttk.web.action.InitStepAction"
name="StepForm"
scope="session"
validate="false">
<forward name="success" path="/step.jsp"/>
</action>
<action path="/stepAction"
type="com.bnpparibas.bfi.ttk.web.action.StepAction"
name="StepForm"
scope="session"
validate="true"
input="/step.jsp">
</action>
</action-mappings>
<!-- ========== Controller Configuration ================================ -->
<controller>
<!-- The "input" parameter on "action" elements is the name of a
local or global "forward" rather than a module-relative path -->
<set-property property="inputForward" value="true"/>
</controller>
<!-- ========== Message Resources Definitions ============================ -->
<message-resources parameter="com.bnpparibas.bfi.ttk.web.ApplicationResources"/>
<!-- ========== Plug Ins Configuration ================================= -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
<set-property property="stopOnFirstError" value="false"/>
</plug-in>
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
</plug-in>
</struts-config>