您的位置:首页 > 编程语言 > Java开发

2013-02-27 复习struts —— 在struts.xml中include 一个xml文件失败

2013-03-02 09:17 375 查看
现象1:tomcat控制台:

信息: Unable to locate configuration files of the name com.wakata.struts2.action

.updown.strut2-updown.xml, skipping

2013-2-27 22:07:12 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info

信息: Parsing configuration file [struts.xml]

现象2:strut2-updown.xml的内容放到strtus.xml中运行正常

========================

解决:

这里出现Unable to locate configuration files of the name com.wakata.struts2.action

.updown.strut2-updown.xml, skipping

可能是因为com.wakata.struts2.action.updown.strut2-updown.xml写错了

试把它改成:<include file="com/wakata/struts2/action/updown/strut2-updown.xml"/>

重启tomcat,控制台没有报这个错了。

尝试访问strut2-updown.xml中描述的action,成功!

============================

总结:

struts.xml中::<include file="com/wakata/struts2/action/updown/strut2-updown.xml"/>

hibernate.cfg.xml中:<mapping resource="com/wakata/test/pojo/test2pojo-hiber.cfg.xml"/>

jsp中引入一个文件:<script type="text/javascript" src="../js/jQuery1.4.1.js"></script> (img标签的src也是用/)

struts.xml和web.xml中的<class> :<servlet-class>com.wakata.servlet.LoginServlet</servlet-class>

java中引入一个类:import java.util.ArrayList;

照上述的看来,一般指定一个类,用的 是" . " ,而指定一个文件,用" / "
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: