struts 多模块配置的问题
web.xml
<web-app>
.....
<init-param>
<param-name> config </param-name>
<param-value> /WEB-INF/struts-config.xml </param-value>
</init-param>
<init-param>
<param-name> config/admin </param-name>
<param-value> /WEB-INF/struts-config-admin.xml </param-value>
</init-param>
......省略
<servlet-mapping>
<servlet-name> netstore </servlet-name>
<url-pattern> /action/* </url-pattern>
</servlet-mapping>
......省略
</web-app>
struts-config.xml
......省略
<global-forwards>
<forward name= "welcome " path= "/action/home "/>
<forward name= "toModuleB "
contextRelative= "true "
path= "/action/admin/admin "
redirect= "true "/>
......省略
</global-forwards>
struts-config-admin.xml
......省略
<global-forwards>
<forward name= "/admin " path= "/admin/admin/index.jsp "/>
</global-forwards>
......省略
jsp页面
<%@ taglib uri= "/WEB-INF/struts-logic.tld " prefix= "logic " %>
<html>
<body>
<logic:forward name= "toModuleB "/>
</body>
</html>
jsp页面报错 eclipse 也报错
type Status report
message Invalid path /admin/admin was requested
description The request sent by the client was syntactically incorrect (Invalid path /admin/admin was requested
各位高手帮看看.谢谢了.
------解决方案--------------------用eclipse编辑器修改
会提示出错的地方
------解决方案--------------------很少写多模块,感觉没啥意义。帮你顶一下
------解决方案--------------------web.xml中:
<!-- Standard Action Servlet Configuration -->
<servlet>
<servlet-name> action </servlet-name>
<servlet-class> org.apache.struts.action.ActionServlet </servlet-class>
<init-param>
<param-name> config </param-name>
<param-value>
/WEB-INF/strutsConfig/global.xml,
/WEB-INF/strutsConfig/forms.xml,
/WEB-INF/strutsConfig/forms-model1.xml,
/WEB-INF/strutsConfig/forms-model2.xml,
/WEB-INF/strutsConfig/forms-model3.xml
</param-value>
</init-param>
<load-on-startup> 2 </load-on-startup>
</servlet>