<package name="resultTypes" namespace="/r" extends="struts-default">
<action name="result_mul" class="cn.edu.hpu.action.ResultAction">
<!-- 这种写法代表在配置文件中可以用这种方法去读值栈里面的内容 -->
<result>${r}</result>
</action>
</package>
package cn.edu.hpu.action;
import com.opensymphony.xwork2.ActionSupport;
public class ResultAction extends ActionSupport {
private int type;
private String r="/Hello.jsp";
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getR() {
return r;
}
public void setR(String r) {
this.r = r;
}
public String execute() throws Exception {
//因为r是后来保存在值栈中的,所以能被配置文件以${r}
//的形式读到
if(type==1) r="/User_Add_success.jsp";
else if(type==2) r="/User_Add_error.jsp";
return SUCCESS;
}
}
<a href="<%=basePath %>/r/result_mul?type=1" rel="external nofollow" >动态结果集1</a> <a href="<%=basePath %>/r/result_mul?type=2" rel="external nofollow" >动态结果集2</a> <a href="<%=basePath %>/r/result_mul?type=3" rel="external nofollow" >动态结果集3</a>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有