Struts验证错误

时间:2014-06-24 15:35:55

标签: java xml validation maven configuration-files

我正在为我的项目使用struts验证。我使用maven依赖。我在struts-config.xml文件中为struts验证添加了插件。

当我添加value='/org/apache/struts/validator/validator-rules.xml'时,会显示错误:

cannot resolve symbol '/org/apache/struts/validator/validator-rules.xml'

我不知道这个错误。当我运行我的项目时,我得到invocationtarget exception

我不确定是否由于此问题或任何其他问题而发生异常。我已经搜索了很多寻找解决方案,但我失败了。下面是我在配置文件中添加的代码。请帮忙解决这个问题:

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames"
            value="/org/apache/struts/validator/validator-rules.xml,/WEB-INF/conf/validation.xml" />
    </plug-in> 

1 个答案:

答案 0 :(得分:0)

  1. 从他的位置http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts/struts-core/1.3.9/org/apache/struts/validator/validator-rules.xml下载validator-rules.xml并添加到您的WEB_INF位置。

  2. 下载struts-core.jar并将此jar文件添加到您的项目中。