eclipse不会验证struts.xml文件 [英] eclipse not validating the struts.xml file

查看:107
本文介绍了eclipse不会验证struts.xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的新专辑中安装了日食并导入我的旧项目struts2,在导入项目后,我得到一个警告在struts.xml文件,即该文件无法验证,因为有一个连接问题。我更换了我的jar文件和doctype这么多次,但仍然没有工作。我也发现eclipse没有显示任何错误,如果我做错了这个文件,即使eclipse清理我的项目需要很多时间来清理struts.xml文件

 <?xml version =1.0encoding =UTF-8?> 

<!DOCTYPE struts PUBLIC
- // Apache Software Foundation // DTD Struts配置2.3 // EN
http://struts.apache.org/的DTD /支杆-2.3.dtd>

< struts>
< package name =aextends =struts-default>
< action name =bclass =com.test>
< result name =success> /success.jsp< / result>
< result name =error> /error.jsp< / result>
< / action>

< / package>

< / struts>

请帮助我,我遇到了很多困难...?

解决方案

将Doctype更改为:

  ;!DOCTYPE struts PUBLIC 
- // Apache Software Foundation // DTD Struts配置2.1 // EN
/WEB-INF/dtds/struts-2.1.dtd\">

并从struts2-core-2.1.8.1.jar中提取struts-2.1.dtd文件到WEB-INF文件夹内的dtds文件夹(CREATE NEW)。


I installed the eclipse in my new p.c. and import my old project of struts2 in that and after importing the project i got a warning in struts.xml file i.e. "The file cannot be validated as there was a connection problem.". I replaced my jar files and doctype so many times but still it didn't work. I also found that eclipse is not showing me any error if i do something wrong in that file even when eclipse clean my project it takes a lot of time to clean struts.xml file

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC 
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
 <package name="a" extends="struts-default">
 <action name="b" class="com.test">
   <result name="success">/success.jsp</result>
         <result name="error">/error.jsp</result>
      </action>

 </package>

</struts>

Please help me for this i am getting lots of difficulties...???

解决方案

Change Doctype to:

 <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "/WEB-INF/dtds/struts-2.1.dtd">

and extract "struts-2.1.dtd" file from "struts2-core-2.1.8.1.jar" into dtds folder(CREATE NEW) inside WEB-INF folder.

这篇关于eclipse不会验证struts.xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆