我的Struts配置文件为:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config>
<data-sources />
<form-beans >
<form-bean name="logonForm" type="org.avlmss.logon.form.LogonForm" />
<form-bean name="ffForm" type="org.avlmss.form.FfForm" />
<form-bean name="testForm" type="org.avlmss.form.TestForm" >
<form-property name="number" type="java.lang.String"></form-property>
<form-property name="myfloat" type="java.lang.String"></form-property>
</form-bean> </form-beans> <global-exceptions />
<global-forwards >
<forward name="error" path="/error/error.jsp" /> </global-forwards> <action-mappings >
<action
attribute="logonForm"
input="/logon/logon.jsp"
name="logonForm"
path="/logon"
scope="request"
type="org.avlmss.logon.action.LogonAction">
<forward name="logonsuccess" path="/main.html" />
</action>
<action
attribute="ffForm"
input="/form/ff.jsp"
name="ffForm"
path="/ff"
scope="request"
type="org.avlmss.action.FfAction" />
<action
attribute="testForm"
input="/form/test.jsp"
name="testForm"
path="/test"
scope="request"
validate="true"
type="org.avlmss.action.TestAction" />
</action-mappings> <controller inputForward="true" /> <message-resources parameter="org.avlmss.resources.ApplicationResources" />
<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="true" />
</plug-in>
</struts-config>
我配置了plug-in,也把validator-rules.xml和validation.xml放在了相应目录下,但Tomcat启动不加载这两个文件,我看Struts给的例子在Tomcat启动时要加载这个PlugIn,但我的没有加载,不知为何?所以在后面验证肯定也不能验证。不知各位大侠有没有遇到过这类问题,如何解决啊!!在线等...............
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config>
<data-sources />
<form-beans >
<form-bean name="logonForm" type="org.avlmss.logon.form.LogonForm" />
<form-bean name="ffForm" type="org.avlmss.form.FfForm" />
<form-bean name="testForm" type="org.avlmss.form.TestForm" >
<form-property name="number" type="java.lang.String"></form-property>
<form-property name="myfloat" type="java.lang.String"></form-property>
</form-bean> </form-beans> <global-exceptions />
<global-forwards >
<forward name="error" path="/error/error.jsp" /> </global-forwards> <action-mappings >
<action
attribute="logonForm"
input="/logon/logon.jsp"
name="logonForm"
path="/logon"
scope="request"
type="org.avlmss.logon.action.LogonAction">
<forward name="logonsuccess" path="/main.html" />
</action>
<action
attribute="ffForm"
input="/form/ff.jsp"
name="ffForm"
path="/ff"
scope="request"
type="org.avlmss.action.FfAction" />
<action
attribute="testForm"
input="/form/test.jsp"
name="testForm"
path="/test"
scope="request"
validate="true"
type="org.avlmss.action.TestAction" />
</action-mappings> <controller inputForward="true" /> <message-resources parameter="org.avlmss.resources.ApplicationResources" />
<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="true" />
</plug-in>
</struts-config>
我配置了plug-in,也把validator-rules.xml和validation.xml放在了相应目录下,但Tomcat启动不加载这两个文件,我看Struts给的例子在Tomcat启动时要加载这个PlugIn,但我的没有加载,不知为何?所以在后面验证肯定也不能验证。不知各位大侠有没有遇到过这类问题,如何解决啊!!在线等...............
把<set-property property="stopOnFirstError" value="true" />去掉看看会不会加载。