按照网上说的在web.xml中更改
[code="xml"]
config
struts-default.xml,struts-plugin.xml,../resources/struts2/struts.xml
[/code]
不管用,报错找不到action(struts.xml在src目录下能正常访问)
有没有人实际操作过?
=============web.xml =============
[code="xml"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- struts2 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>../struts2conf/struts.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.wml</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
[/code]
===============struts.xml================ 在 struts2conf 目录下
[code="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">
<!-- struts2 默认配置文件,必须加进来 有这里看出,当前文件的路径是跟路径下classes路径,所以其他的文件要从classes这个路径开始找 -->
<!-- 自己添加的配置文件 注意路径 -->
[/code]
1、struts2默认加载顺序是:
struts-default.xml
struts-plugin.xml(可能多个)
struts.xml
你不需要指定那个顺序
2、报什么错误 具体错误及配置文件 和 action 贴出来