I recently downloaded the latest Struts 1.1b2 and I am trying to get the
validator working. I did drop the struts validator war into Weblogic and it
validates fine.
In my test, I did my own ValidatorTestForm which extends ValidatorForm and
implements Serializable and it does not contain a validate method. It
contains two string fields name and number.
In the Struts config file I have added the plug-in:
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathname"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
In my validation.xml file I have put
<form name="validatorTestForm">
<field property="name" depends="required">
<arg0 key="validatorTestForm.name"/>
</field>
<field property="number" depends="required">
<arg0 key="validatorTestForm.number"/>
</field>
</form>
In this simple test I have testValidator.jsp that has the name and number
fields on it. Its form's target is validatorTest.do which looks like this:
<action path="/validatorTest"
type="com.companyname.project.web.test.ValidatorTestAction"
name="validatorTestForm"
validate="true"
scope="request">
<forward name="success" path="/test/validatorTestResults.jsp"/>
<forward name="error" path="/error.jsp"/>
</action>
I go to this JSP page but instead of entering anything in for name and
number I just press submit (I want to test the required condition). I can
set a breakpoint in the Struts file ValidatorForm in its validate method but
the validatorResults always comes back with a count of zero and nothing ever
gets stuck into ActionErrors.
Can anyone please tell me what I am missing?
Many Thanks!
Erich Kilmer
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>