WebWork中动态生成Result
来源:互联网 发布:网络暴力的成因 编辑:程序博客网 时间:2024/05/25 08:15
当在xwork.xml中配置<action>时,在<result>部分可以写成这样:
......
<result name="success" type="redirect">
<param name="location">/${path}</param>
</result>
......
其中,${}包含了一个ognl表达式,从WebWork的OgnlValueStack中获取内容,进而动态生成内容。
在Action中可以这样写:
......
private String path;
public String getPath(){
return path;
}
public String execute() throws Exception {
//把下面的代码解除注释可以在stack中存储其它的对象
//HttpServletRequest request=ServletActionContext.getRequest();
//OgnlValueStack stack=ServletActionContext.getValueStack(request);
path="success.jsp";
return SUCCESS;
}
由于Action会位于栈顶,因此"${path}"会调用getPath()方法,获得"success.jsp",动态生成结果"/success.jsp"。
- WebWork中动态生成Result
- 在WebWork中实现自己的Result Type
- Webwork默认result配置
- webwork[jsp result]
- WebWork中使用动态Form字段
- WebWork中使用动态Form字段
- Struts2中动态的result
- webwork chain类型的result
- Webwork配置文件中interceptors,result-types,global-results,default-interceptor-ref,action标签顺序问题
- Webwork Result失效的一个错误
- WebWork 学会配置action、result和interceptor
- WebWork动态填充Select
- WebWork动态填充Select
- webwork中路径
- webwork标签(不断更新中)
- 使用Webwork Chain Result Type进行参数传递
- 自定义webwork的Intercepter和Result实现简单工作流
- struts2 action 动态result
- 一学就会魔法书--中文Dreamweaver网页制作真是一本好书
- Webwork Result失效的一个错误
- 优化一般思路/模式(三)
- 博客访问量逼近30000大关,多谢大家支持
- NGN五大协议
- WebWork中动态生成Result
- java中类的继承
- 晕啊,格式化一个盘了
- 解决ssh远程登录unix服务器时vi/vim的方向键在编辑模式不能用的问题
- 论软交换基础上的WCDMA网络
- CrystalReport与ASP.net的集成
- java中break语句应注意的
- SS7 / SIGTRAN
- 一件关于域名抢注的国际纠纷