struts文件异常Included file cannot be found

1.命名规范,都是采用struts-xxx.xml文件,即以struts开头

2.file的路径不要以/开头,在其他版本是以/开头的

  <include file="/com/bjsxt/struts2/ognl/ognl.xml"/>这一行报错,提示错误Included file cannot be found,

  解决方案是将文件路径前面的/去掉<include file="com/bjsxt/struts2/ognl/ognl.xml"/>

3.复制struts.xml,然后改名,struts-user.xml,再粘贴,这样就不会报错了。

 或者 新建一个xml,然后将内容复制粘贴进去。

 

原文地址:https://www.cnblogs.com/haimishasha/p/6188228.html