日期:2014-05-19  浏览次数:20644 次

struts2 登陆成功后url里显示.action而不是.jsp
在login.jsp登陆成功后进入index.jsp页面,但是url显示的是 http://localhost:8090/strDemo/login.action
我希望显示的是http://localhost:8090/strDemo/index.jsp 不希望用redirect 
在struts.xml中的登陆是这样的 
<action name="login" class="suncw.demo.action.LoginAction">
  <result name="success">/index.jsp</result>
<result name="input">/login.jsp</result>
</action>

谢谢了~

------解决方案--------------------
。。 struts跳转就是 拦截器拦截的*.action 你要直接跳jsp 用href 。。
------解决方案--------------------
默认为转发当然显示.action,如果修改为重定向的话就是显示.jsp

<result name="error" type="dispatcher">--转发
<result name="success" type="redirect">--重定向。
------解决方案--------------------
把值存在session中,使用重定向
页面使用<s:property value="#session.mySessionPropKey"/>