validator不验证
不知道为什么,我怎么也找不到不验证的原来。请各位大虾帮帮忙看看。
struts-config.xml中的代码是:
<?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= "loginForm " type= "com.yourcompany.struts.form.LoginForm " />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute= "loginForm "
input= "/login.jsp "
name= "loginForm "
path= "/login "
scope= "request "
validate= "true "
type= "com.yourcompany.struts.action.LoginAction ">
<forward name= "success " path= "/index.jsp " />
</action>
</action-mappings>
<message-resources parameter= "com.yourcompany.struts.ApplicationResources " />
<plug-in className= "org.apache.struts.validator.ValidatorPlugIn ">
<set-property property= "pathnames "
value= "/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml "/>
</plug-in>
</struts-config>
validation.xml中的代码是:
<?xml version= "1.0 " encoding= "UTF-8 "?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN "
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd ">
<form-validation>
<formset>
<form name= "loginForm ">
<field property= "userName " depends= "required ">
<arg key= "registrationForm.userName.displayname " position= "0 "/>
</field>
</form>
</formset>
</form-validation>
jsp中的代码是:
<%@ page contentType= "text/html;charset=UTF-8 " %>
<%@ taglib uri= "/tags/struts-bean " prefix= "bean " %>
<%@ taglib uri= "/tags/struts-html " prefix= "ht