1

我在struts2中使用struts2-convention-plugin和struts2-config-browser-plugin,如果我更改默認的struts.xml路徑在web.xml中:struts2-convention和struts2-config-browser-plugin不能工作,如果我更改struts.xml路徑

<filter> 
    <filter-name>struts2</filter-name> 
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 
    <init-param> 
     <param-name>config</param-name> 
     <param-value>struts-default.xml,struts-plugin.xml,struts/struts.xml</param-value> 
    </init-param> 
</filter> 

他們不能再工作了,爲什麼?

回答

0

struts/struts.xml用於定位Struts配置文件,但不能打開它,因爲它不存在。改爲使用struts.xml並將其放到classpath中。

+0

我將classpath struts.xml更改爲struts/struts.xml,因此它存在。 –

+0

@TardisXu文件名是錯誤的,它應該是一個正確的文件名,而不是文件路徑或協議。 –

+0

它可以在沒有struts2-convention-plugin的情況下工作。 –