struts2校验器规范错误解决

  今天struts2的校验器的配置文件文件头出现了错误,配置如下:

<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
        "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

      出错信息如下:

Referenced file contains errors (http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd). For more information, right click on the message in the Problems 
View and select "Show Details..."

      上网查了一下,原因是http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd已经不是dtd约束文件了,打开网址,发现opensymphony的网址已经迁移走了,因为xwork的东西已经并入struts2中,成为apache的一部分。所有的dtd已经移交到http://struts.apache.org/dtds/ 这个地方。

      以后struts2的校验器的规范要改成:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
       这样就不会报错了,运行正常。

posted on 2013-10-29 11:45  荒荒9468  阅读(267)  评论(0编辑  收藏  举报