配置文件:struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.custom.i18n.resources" value="q2c"/>
<constant name="struts.i18n.encoding" value="UTF-8" />
<constant name="struts.objectFactory" value="spring" />
<constant name="struts.devMode" value="true" />
<constant name="struts.server.static.browserCache" value="false"/>
<constant name="struts.configuration.xml.reload" value="true" />
<constant name="struts.ui.theme" value="simple" />
省略…
<include file="com/qtoc/config/item/item.xml"></include>
</struts>
item.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
省略…
<package name="item" namespace="/item" extends="qtoc">
<action name="spStyleManageUI*" class="com.qtoc.item.action.style.SpStyleManageAction"
method="{1}">
<result>/WEB-INF/base/item/{1}_style.jsp</result>
</action>
</package>
</struts>
在页面上有XXX.Jsp:
<s:url action="spStyleManageUIaddUI" namespace="/item"/>
如果是把item.xml包含在Struts.xml中,当启动tomcat解析XXX.jsp时
<s:url action="spStyleManageUIaddUI" namespace="/item"/>
会被解析成:/item/spStyleManageUIaddUI;jsessionid=37289372937293872893273如果把:
<action name="spStyleManageUI*" class="com.qtoc.item.action.style.SpStyleManageAction"
method="{1}">
<result>/WEB-INF/base/item/{1}_style.jsp</result>
</action>
直接写在Struts.xml里面,解析出来就是:
/item/spStyleManageUIaddUI
现在还不知道是什么原因,发现后就贴上来了,希望同网友分享,解决原因。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.custom.i18n.resources" value="q2c"/>
<constant name="struts.i18n.encoding" value="UTF-8" />
<constant name="struts.objectFactory" value="spring" />
<constant name="struts.devMode" value="true" />
<constant name="struts.server.static.browserCache" value="false"/>
<constant name="struts.configuration.xml.reload" value="true" />
<constant name="struts.ui.theme" value="simple" />
省略…
<include file="com/qtoc/config/item/item.xml"></include>
</struts>
item.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
省略…
<package name="item" namespace="/item" extends="qtoc">
<action name="spStyleManageUI*" class="com.qtoc.item.action.style.SpStyleManageAction"
method="{1}">
<result>/WEB-INF/base/item/{1}_style.jsp</result>
</action>
</package>
</struts>
在页面上有XXX.Jsp:
<s:url action="spStyleManageUIaddUI" namespace="/item"/>
如果是把item.xml包含在Struts.xml中,当启动tomcat解析XXX.jsp时
<s:url action="spStyleManageUIaddUI" namespace="/item"/>
会被解析成:/item/spStyleManageUIaddUI;jsessionid=37289372937293872893273如果把:
<action name="spStyleManageUI*" class="com.qtoc.item.action.style.SpStyleManageAction"
method="{1}">
<result>/WEB-INF/base/item/{1}_style.jsp</result>
</action>
直接写在Struts.xml里面,解析出来就是:
/item/spStyleManageUIaddUI
现在还不知道是什么原因,发现后就贴上来了,希望同网友分享,解决原因。
解决方案 »
- 请问下jboss的 Run Server和 Debug Server 启动有什么区别
- 急,急,在线等!!! struts 1.2 二次迭代输出有问题。
- 用struts和jsp相互转向出现的问题
- 一个小问题,大家有没有知道的
- struts页面数据库显示问题
- struts标签logic:iterate的郁闷问题
- 多线程大家在项目中怎么用的啊 进程又是怎么回事呢 ???
- JDK里的Applet Viewer怎么打开呀?
- 在客户端调用jboss服务器上的ejb方法,我的客户端代码已经写好并打包,只是不知道如何去执行,需要哪些设置。
- jboss下用sessionBean的container控制事务不起作用?详见>>
- IMB jdk1.5 部署项目 在tomcat6下启动报java.lang.ClassNotFoundException: javax.jws.WebServi
- Hibernate 一点问题
包含的问题,但还没测试是不是版本问题。
<interceptors>
<interceptor name="user" class="com.qtoc.base.action.interceptor.UserInterceptor"/>
<interceptor-stack name="userPermissionStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="user"/>
</interceptor-stack>
</interceptors>
<global-results>
<result name="message">/WEB-INF/base/share/message.jsp</result>
<result name="directUrl">/WEB-INF/base/share/directUrl.jsp</result>
<result name="check">/WEB-INF/base/share/checkcode.jsp</result>
</global-results>
</package>
<input type="button" name="Add" value=" <s:text name="submit"/> " class="frm_btn" onClick="javascript:SureSubmit(this.form)"/>
<input type="button" name="Return" value=" <s:text name="return"/> " class="frm_btn" onclick="javascript:history.back()"/>
我其实是想解决这个问题。结果发现了上面的问题。
这个问怎么回事,请高手看看,点检按钮就错了,是在IE上面,Firefox就点不动,但我以前写的可以点击,也没有报错。真不知道是怎么回事?
<s:a href="%{finduser}"></s:a>
你这样引用试试,我没发现你所说的问题。
但只有有命名空间namespace是才这样。这可能是Struts2的内部机制,当要访问命名空间是传一个sessionID作为标识,这只是我的推测。