struts2的@Result annotation 如何添加params,并且在页面取值
http://www.bubuko.com/infodetail-2492575.html
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
标签:lai util date cati rec turn nds csdn bsp
http://blog.csdn.net/z69183787/article/details/16342553
struts2的@Result annotation 如何添加params,并且在页面取值
1、action跳转至jsp
后台:(需有get set 方法)
- @SuppressWarnings("rawtypes")
- @Action(value="/loadFileList",results={
- @Result(name="attachList",location="/attach/attachList.jsp",params={"attachMemo1","${attachMemo1}"}),
- @Result(name="attachList1",location="/attach/attachList1.jsp"),
- @Result(name="attachListHT",location="/attach/attachListHT.jsp")})
前台:
- <%out.println(request.getAttribute("attachMemo1")); %>
2、action跳转至action
后台:(stptuser为 action中的bo)
- @Action(value="stptUserUpdate",results={
- @Result(name="stptUserEdited",params={"actionName","stptUserView","stptUserId","%{stptUser.id}"},type="redirectAction")
- })
或者
- @Result(name="success",
- type="redirectAction",
- location="d-list",
- params={"id", "%{id}"}
- )
另一个action获取
- @Action(value="stptUserView",results={
- @Result(name="success",location="/userManage/stptUserView.jsp")
- })
- public String stptUserView(){
- String id = StringUtil.getNotNullValueString(super.getServletRequest().getParameter("stptUserId"));
- this.stptUser = this.stptUserService.findStptUserById(Long.parseLong(id));
- List<ManagerVo> list = this.stptUserService.getUserInfo(id);
- List<ManagerVo> agentList = this.stptUserService.getAgentInfo(id);
- super.getServletRequest().setAttribute("voList", list);
- super.getServletRequest().setAttribute("agentList", agentList);
- return SUCCESS;
- }
标签:lai util date cati rec turn nds csdn bsp
原文:https://www.cnblogs.com/ConfidentLiu/p/8434662.html
struts2的@Result annotation 如何添加params,并且在页面取值的更多相关文章
- struts2的@Result annotation 如何添加params
参考: http://struts.apache.org/2.0.11/docs/result-annotation.html http://jdkcn.com/entry/add-params-to ...
- dir(dict)|字典的创建-添加-删除-修改-判断存在-取值等相关操作
dir(dict) ####字典操作:创建-添加-删除-修改-判断存在-取值 #(一)创建字典: {} .等号. zip(). [(),()] #1.创建空字典 dict0 = {} #2.等号创建 ...
- js动态添加-表格逐行添加、删除、遍历取值
关于js对表格进行逐行添加,今天抽空整理了一下:新建一个html文件(没有编辑器的可以新建一个demo.txt文件,然后改后缀名为demo.html),把下面代码全部贴进去即可.功能包括:表格添加一行 ...
- struts2的action的知识点和利用action向页面注入值的操作
1. Action的顺序,会先搜索指定名字下的包的action,如果找不到会去搜索默认路径下的包下的action. 2. 如果没有给action设置值,那么action会有一些默认 ...
- Struts2 配置文件result的name属性和type属性
Struts2 配置文件result的name属性和type属性:Name属性SUCCESS:Action正确的执行完成,返回相应的视图,success是 name属性的默认值: NONE:表示Act ...
- Struts2 自定义Result
注意:我只要是解决自定义返回Json 和异常处理问题 新建一个类 AjaxResult 继承 StrutsResultSupport 看看代码吧 public class AjaxResult e ...
- Struts2中基于Annotation的细粒度权限控制
Struts2中基于Annotation的细粒度权限控制 2009-10-19 14:25:53| 分类: Struts2 | 标签: |字号大中小 订阅 权限控制是保护系统安全运行很重要 ...
- Struts2之Result详解
上一篇我们把Struts2中的Action接收参数的内容为大家介绍了,本篇我们就一起来简单学习一下Action的4种Result type类型,分为:dispatcher(服务端页面跳转):redir ...
- Caused by: The Result type [json] which is defined in the Result annotation on the class
1.错误描述 严重: Dispatcher initialization failed Unable to load configuration. - [unknown location] at co ...
随机推荐
- Ubuntu 14.04 下 android studio 安装 和 配置【转】
本文转载自:http://blog.csdn.net/xueshanfeihu0/article/details/52979717 Ubuntu 14.04 下 android studio 安装 和 ...
- 存储过程系列二:适用函数wm_concat(column)函数实现字段合并
1.学习wm_concat函数 oracle wm_concat(column)函数使我们经常会使用到的,下面就教您如何使用oraclewm_concat(column)函数实现字段合并 shoppi ...
- Vue表格数据增删改查及搜索
<div id="app"> <div class="item"> <span class="name"> ...
- 【C/C++】任意大于1的整数分解成素数因子乘积的形式
// #include<stdio.h> #include<math.h> #include<malloc.h> int isprime(long n); void ...
- Tensorflow基础知识
基本知识 使用 TensorFlow, 你必须明白 TensorFlow: 使用图 (graph) 来表示计算任务. 在被称之为 会话 (Session) 的上下文 (context) 中执行图. 使 ...
- C语言之fileno()函数--获取已经打开的文件的文件描述符(小技巧)
open函数相关的: /* open 是系统调用 返回的是文件句柄*/ #include <sys/stat.h> #include <fcntl.h> int open(c ...
- [转]解决pycharm无法导入本地包的问题(Unresolved reference 'tutorial')
原文地址:https://www.cnblogs.com/yrqiang/archive/2016/03/20/5297519.html
- 回味经典——uboot1.1.6 之 第一阶段
转自:http://blog.csdn.net/lizuobin2/article/details/52054293 最近打算移植一个比较新的 uboot 到开发板,回想起来上一次移植 uboot1. ...
- Httpclient: 多层翻页网络爬虫实战(以搜房网为例)
参考:http://blog.csdn.net/qy20115549/article/details/52912532 一.创建数据表 #创建表:用来存储url地址信息 create table so ...
- java集合框架之ArrayList与LinkedList的区别
参考http://how2j.cn/k/collection/collection-arraylist-vs-linkedlist/690.html#nowhere ArrayList和LinkedL ...