Hi,
I am trying to integrate the validator framework into an existing application, but unfortunatly it does not work and I have no clue why.
I did the following things:
1. Added this to my struts-config file:
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathname" value="/WEB-INF/validator-rules.xml"/>
<set-property property="pathname" value="/WEB-INF/validator.xml"/>
</plug-in>
2. Modified an example form bean to extends ValidatorForm.
3. Added this to my web.xml
<
servlet>
<servlet-name>validator</servlet-name>
<servlet-class>org.apache.struts.validator.action.ValidatorServlet</servlet-class>
<init-param>
<param-name>config-rules</param-name>
<param-value>/WEB-INF/validator-rules.xml</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/validator.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
4. Added a validation rule to validator.xml
<form-validation>
<formset>
<form name="bookForm">
<field property="title" depends="required"/>
<field property="pages" depends="required"/>
</form>
</formset>
</form-validation>
Validation is enabled and my reference in struts-config.xml is called "bookForm".
Did I miss anything?
When I submit my form nothing without the required data nothing happens. If I insert a validate method it works great, but without ... ?
Does anyone have an idea what might be the problem?
Thanks in advance.
Greets.
jay
-------
SCJP,
SCJD