ava method org.apache.struts2.components.Form.getValidators(String) threw an exception when invoke
struts2校驗框架
校驗配置文件的DTD在xword-core-2.2.3.jar中,系統(tǒng)自帶的校驗器的xml配置文件是
xword-core-2.2.3.jar里com.opensymphony.xword2.vilidator.validators.default.xml文件
校驗配置文件名稱必須為
ActionClassName-validation.xml:Action類名-validation.xml
ActionClassName-ActoinAliasName-validation.xml:Action類名-類別名-validation.xml
類別名為在struts.xml中action的name屬性名。
在 s:form 中添加validation=”true”屬性,這樣,客戶端會根據(jù)服務(wù)端校驗框架自動生產(chǎn)客戶端的javascript語句,在客戶端進行驗證。
今天我做的時候,爆出了
Java method “org.apache.struts2.components.Form.getValidators(String)” threw an exception when invoked on org.apache.struts2.components.Form object “org.apache.struts2.components.Form@60b8d40e”; see cause exception in the Java stack trace.
網(wǎng)上一搜各種解釋都有
struts2類型轉(zhuǎn)換+校驗
Struts2.1.8 驗證框架(validation)的使用中遇到的一些問題(直接訪問jsp遇到的錯誤)
最后的解決方法
- 在表單要提交的Action后面加上 .action
- struts.xml
轉(zhuǎn)載于:https://www.cnblogs.com/A-yes/p/9894198.html
總結(jié)
以上是生活随笔為你收集整理的ava method org.apache.struts2.components.Form.getValidators(String) threw an exception when invoke的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言重要知识点回顾
- 下一篇: iOS微博项目(一)