struts2学习(6)struts2中的动态结果集
来源:互联网 发布:汽车保险算法 编辑:程序博客网 时间:2024/05/21 21:46
struts2中的动态结果集
struts2中的动态结果集,举例说明:
1、 url中调用Action
http://localhost:8080/struts2_1700_DynamicResult/user?type=1
http://localhost:8080/struts2_1700_DynamicResult/user?type=2
2、 struts.xml配置文件:
<struts>
<!-- Add packages here -->
<constant name="struts.devMode" value="true" />
<package name="resultType" namespace="/" extends="struts-default">
<action name="user" class="net.dreamcreating.UserAction">
<result>${r}</result>
</action>
</package>
</struts>
3、 在UserAction中包括两个属性:type和r (程序如下所示)
package net.dreamcreating;
import com.opensymphony.xwork2.ActionSupport;
public class UserAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private int type;
private String r;
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;
}
@Override
public String execute() throws Exception {
if(type==1)
r = "/user_success.jsp";
else
r = "/user_error.jsp";
return SUCCESS;
}
}
- struts2学习(6)struts2中的动态结果集
- struts2动态结果集
- struts2 动态结果集
- Struts2 动态结果集
- Struts2动态结果集
- struts2--动态结果集
- struts2 动态结果集 dynamic_results
- struts2学习(7)struts2中的带参数的结果集
- Struts2中的全局结果集
- struts2动态结果
- Struts2学习---result结果集
- Struts2-ResultType-3-动态结果集(dynamic_Results)
- Struts2中的结果类型
- Struts2中的结果视图
- Struts2中的全局结果
- 全局结果集,带参数的结果集和动态结果集(struts2)
- struts2学习笔记(6)------配置struts2中的异常处理
- struts2学习(3)struts2中的Action
- API Demo Snake代码分析二 onSaveInstanceState和onRestoreInstanceState分析
- java接口实现
- winVNC 源代码分析
- Asp.Net使用开放式并发
- Myeclipse6.5优化技巧
- struts2学习(6)struts2中的动态结果集
- 猪的悲哀在于猪的繁殖能力强
- ASP.net 仿QQ弹出窗口
- JQ $.each()
- Visual.Assist.X.V10.6.1859的Crack破解补丁,有较大更新,推荐!!2011.10.02(General release.)
- 对聊天的看法
- Literal控件的用法
- 实用算法实现-第 17 篇强连通分支
- window.showModalDialog的传值和返回值