eclipse不会验证struts.xml文件 [英] eclipse not validating the struts.xml file
问题描述
<?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屋!