当前位置: 代码迷 >> J2EE >> struts2配置文件struts.xml出错解决办法
  详细解决方案

struts2配置文件struts.xml出错解决办法

热度:105   发布时间:2016-04-22 02:04:03.0
struts2配置文件struts.xml出错
struts2配置文件struts.xml 中找不到dtd文件

struts.xml配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="jiangnan" namespace="/test" extends="struts-default">
<action name="helloworld" class="com.jiangnan.action.HelloWorldAction" method="execute">
<result name="success">/WEB-INF/page/hello.jsp</result>
</action>
</package>
</struts>

错误信息如下:
The errors below were detected when validating the file "struts-2.0.dtd" via the file "struts.xml". In most cases these errors can be detected by validating "struts-2.0.dtd" directly. However it is possible that errors will only occur when struts-2.0.dtd is validated in the context of struts.xml.

求高手赐教!

------解决方案--------------------
缺Struts2-core-xxx.jar包。(dtd文件在这Jar包中。)
------解决方案--------------------
jar问题哦
------解决方案--------------------
以前也遇到过这种问题,有一种情况是上网能解决。也可能是jar包没搞好
  相关解决方案