|
|
|
struts的多模块应用问题--html:form
|
2005年03月19日 17:34
|
|
|
标签列表
|
|
描述: 1.logon.jsp页面中一个表单对象,用于提交登录的用户名和密码: <html:form action="/system/logon.do?action=logon">
2.两个Struts模块:struts-config.xml,struts-config-system.xml.要求是/system/logon.do是映射到Struts-config-system.xml文件.
问题: 用户第一次访问的时候,是处于default模块的,当提交表单时,系统不会到Struts-config-system.xml文件中找,而是到Struts-config.xml中找,所以会报以下错误:javax.servlet.ServletException: Cannot retrieve mapping for action /system/logon
后来我试过各种写法(/logon.do,../logon.do等)都没成功.我看了一下最新的Struts包中的<html:link/>,他有个module属性,可以很方便的转到指定的模块.而<html:form />没有.
不知道哪位高手有解决方法?(我不希望把/logon.do放到default模块中)
|
|
|
|
|
|
Re: struts的多模块应用问题--html:form
|
2005年03月20日 10:49
|
|
|
>是/system/logon.do是映射到Struts-config-system.xml文
虽然你配置的是不同.xml,但是只要加载,Struts认为是统一的配置,没有具体细分的。
这个问题可能是你没有加载Struts-config-system.xml,需要在web.xml中配置一下
|
|
|
|
|
|
Re: struts的多模块应用问题--html:form
|
2005年03月21日 09:30
|
|
|
我在web.xml已经有配置了 <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>config/system</param-name> <param-value>/WEB-INF/struts-config-system.xml</param-value> </init-param>
我猜想是不是<html:form/>在做ActionForm映射时就没有做模块转换...
|
|
|
|
|
|
Re: struts的多模块应用问题--html:form
|
2005年03月21日 09:31
|
|
|
我在web.xml已经有配置了 <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>config/system</param-name> <param-value>/WEB-INF/struts-config-system.xml</param-value> </init-param>
我猜想是不是<html:form/>在做ActionForm映射时就没有做模块转换...
|
|
|
|
|
|
Re: struts的多模块应用问题--html:form
|
2005年04月18日 00:24
|
|
|
应该这样配置 <init-param> <param-name>config</param-name> <param-value> /WEB-INF/struts-config.xml,WEB-INF/struts-config-system.xml</param-value> </init-param>
|
|
|
|