struts中的跳转问题 倒!咋得都可以啊!不就和一个Servlet转到另一个Servlet一样吗?你可以使用return new ActionForward(""),也可以response.sendRedirect("")啊!嘿嘿! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 然后再重定向之后return null就OK了! //前面代码略execute(,){ String strMapJump = null; tacheNo = Integer.parseInt(request.getParameter("tacheNo")); switch(tacheNo){ case 1: strJumpMap = "success1"; break; case 2: strJumpMap = "success2"; break; } return mapping.findforward(strJumpMap);}//配置struts-confg.xml<action-mappings><action attribute="loginForm"name="loginForm"path="login"scope="request"type="com.test.loginAction"><forwardname="success1"path="/login/success1.jsp"redirect="true"/><forwardname="success2"path="/login/success2.jsp"redirect="true"/></action></action-mappings>根据传递的tacheNo值的不同,跳转到不同的页面。朋友,可以看明白么? 你想跳转到另一个action ,同样容易,比如把tache=2映射到跳转到userShowAction,只要这样修改。//配置struts-confg.xml<action-mappings><action attribute="loginForm"name="loginForm"path="login"scope="request"type="com.test.loginAction"><forwardname="success1"path="/login/success1.jsp"redirect="true"/><forwardname="success2"path="/userShow.do"redirect="true"/></action></action-mappings> 往配置里一下, 直接forware过去不就得了 直接配置<forward...的path属性,指向一个ACTION即可。ACTION和JSP在structs看来是同质的,都是一种资源。 而且发出forward转发的action和接收forward的action使用同一个form,这点要明白。 return new ActionFoward("next.do"); Action1里:return mapping.findforward("gotoanother");struts-config.xml<global-forwards > <forward name="gotoanother" path="another.do"/></global-forwards> request.getRequestDispatcher没有反应 jquery问题 关于函数调用的问题。。 单点登录系统与本地保存用户信息的区别是什么 我上传错了资料,怎么删除啊? 两个xml文档之间的问题 在Tomcat中部署servlet还差什么? 送分咯.第一个进来的送 --- 白痴问题请教Hibernate前辈 --- 服务器端用java,客户端用delphi,高手请进!! Struts问题:怎么在JSP里取到FormBean里的属性值? 知道SOAP报文,没有wsdl文件如何开发SOAP程序
execute(,){
String strMapJump = null;
tacheNo = Integer.parseInt(request.getParameter("tacheNo"));
switch(tacheNo){
case 1:
strJumpMap = "success1";
break; case 2:
strJumpMap = "success2";
break;
} return mapping.findforward(strJumpMap);
}//配置struts-confg.xml
<action-mappings>
<action
attribute="loginForm"
name="loginForm"
path="login"
scope="request"
type="com.test.loginAction">
<forward
name="success1"
path="/login/success1.jsp"
redirect="true"/>
<forward
name="success2"
path="/login/success2.jsp"
redirect="true"/>
</action>
</action-mappings>根据传递的tacheNo值的不同,跳转到不同的页面。
朋友,可以看明白么?
只要这样修改。
//配置struts-confg.xml
<action-mappings>
<action
attribute="loginForm"
name="loginForm"
path="login"
scope="request"
type="com.test.loginAction">
<forward
name="success1"
path="/login/success1.jsp"
redirect="true"/>
<forward
name="success2"
path="/userShow.do"
redirect="true"/>
</action>
</action-mappings>
ACTION和JSP在structs看来是同质的,都是一种资源。
struts-config.xml
<global-forwards >
<forward name="gotoanother" path="another.do"/>
</global-forwards>