2011-02-24 65 views
0

錯誤/例外:在應用範圍沒有發現驗證框架Struts中

了ValidatorResources下鍵「org.apache.commons.validator.VALIDATOR_RESOURCES

框架:Struts1.2 /驗證框架

罐使用的文件:

commons-validator-1.3.1 
commons-beanutils-1.8.0 
commons-chain-1.2 
commons-digester-1.8 
commons-logging-1.0.4 

裏面所有lib文件夾

在struts-config.xml配置

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

問:我在哪裏 「validator_rules.xml」 文件?

回答

2

From the Struts documentation

按照慣例,你的應用程序使用,可以通過一個名爲「驗證 - rules.xml中」文件中加載的驗證,以及驗證的形式(或「驗證」),可以單獨配置(比如說,在「validations.xml」文件中)。

您從Struts安裝中獲得validator-rules.xml(而不是validator_rules.xml)。看看裏面搜索正確的名稱(與-不是_)。

「src」存檔肯定會包含它。