http://blog.csdn.net/z69183787/article/details/16342553

struts2的@Result annotation 如何添加params,并且在页面取值

1、action跳转至jsp

后台:(需有get set 方法)

  1. @SuppressWarnings("rawtypes")
  2. @Action(value="/loadFileList",results={
  3. @Result(name="attachList",location="/attach/attachList.jsp",params={"attachMemo1","${attachMemo1}"}),
  4. @Result(name="attachList1",location="/attach/attachList1.jsp"),
  5. @Result(name="attachListHT",location="/attach/attachListHT.jsp")})

前台:

  1. <%out.println(request.getAttribute("attachMemo1")); %>

2、action跳转至action

后台:(stptuser为 action中的bo)

  1. @Action(value="stptUserUpdate",results={
  2. @Result(name="stptUserEdited",params={"actionName","stptUserView","stptUserId","%{stptUser.id}"},type="redirectAction")
  3. })

或者

  1. @Result(name="success",
  2. type="redirectAction",
  3. location="d-list",
  4. params={"id", "%{id}"}
  5. )

另一个action获取

    1. @Action(value="stptUserView",results={
    2. @Result(name="success",location="/userManage/stptUserView.jsp")
    3. })
    4. public String stptUserView(){
    5. String id = StringUtil.getNotNullValueString(super.getServletRequest().getParameter("stptUserId"));
    6. this.stptUser = this.stptUserService.findStptUserById(Long.parseLong(id));
    7. List<ManagerVo> list = this.stptUserService.getUserInfo(id);
    8. List<ManagerVo> agentList = this.stptUserService.getAgentInfo(id);
    9. super.getServletRequest().setAttribute("voList", list);
    10. super.getServletRequest().setAttribute("agentList", agentList);
    11. return SUCCESS;
    12. }

@Results( 中 params 怎么用的更多相关文章

  1. rails中params[:id]与params["id"]分析

    写这个帖子的缘由是因为在页面参数传到rails的controller时用params[:]和params[""]都可以取到值: [1] pry(#<BooksControll ...

  2. 【原】vue-router中params和query的区别

    1.引入方式不同 query要用path来引入 this.$router.push({ path: 'test', query: { type: 2, detail: '哈哈' } }) params ...

  3. c#中params关键字应用

    c#params应用 params 是C#开发语言中关键字, params主要的用处是在给函数传参数的时候用,就是当函数的参数不固定的时候. 在方法声明中的 params 关键字之后不允许任何其他参数 ...

  4. vue中params & query的比较

    共同点: 1.都可以传值 2.在另外一个组件中传递值的时候,都是放在$route中 不同点: 1.传值时候,url的表现不一样 query /orderInfo?xxx=yyy&aaa=bbb ...

  5. C#中params使用

    1.参数被params修饰即为可变参数,params只能修饰一维数组. 2.给可变参数赋值的时候,可以直接传递数组的元素. 3.在调用的时候,会自动将这些元素封装为一个数组,并将数组传递. 4.可变参 ...

  6. get请求中params参数的使用

    一.当发送一个get请求的时候,如果有参数,那么参数应该怎么处理呢? 比如,百度阅读里面,查询书的列表,点击进去,它是一个get请求,地址是:https://yuedu.baidu.com/book/ ...

  7. struts2的@Result annotation 如何添加params,并且在页面取值

    http://www.bubuko.com/infodetail-2492575.html .............................................. 标签:lai  ...

  8. 记录python接口自动化测试--从excel中读取params参数传入requests请求不生效问题的解决过程(第七目)

    在第六目把主函数写好了,先来运行一下主函数 从截图中可以看到,请求参数打印出来了,和excel中填写的一致 但是每个接口的返回值却都是400,提示参数没有传进去,开始不知道是什么原因(因为excel中 ...

  9. ArcGIS API for JavaScript 中的数据类型【vs】GPServer的数据类型

    熟悉GPServer的同学肯定知道,GPServer在10.1的ArcMap后需要执行成功一次才能发布. 发布GPServer,可以是ArcMap的工具箱的工具,也可以是自己写的模型. 不管是ArcM ...

随机推荐

  1. HDU5015 233 Matrix —— 矩阵快速幂

    题目链接:https://vjudge.net/problem/HDU-5015 233 Matrix Time Limit: 10000/5000 MS (Java/Others)    Memor ...

  2. poj3295 Tautology —— 构造法

    题目链接:http://poj.org/problem?id=3295 题意: 输入由p.q.r.s.t.K.A.N.C.E共10个字母组成的逻辑表达式, 其中p.q.r.s.t的值为1(true)或 ...

  3. centos服务器安装配置Postgre9.6

    安装: STEP1:下载对应rpm yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64 ...

  4. 「NOIP2014」「Codevs3728」 联合权值(乱搞

    3728 联合权值 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold   题目描述 Description 输入描述 Input Description 输出描述 Ou ...

  5. TortoiseGit创建本地库并提交到远程服务器

    前半部分参考网上的例子:http://www.showerlee.com/archives/1300,但会出现“Git did not exit cleanly (exit code 128)”错误 ...

  6. mysql跨表更新示例

    一.在同一个表中冗余存储记录之间的关系(组织机构树),查询时需要根据冗余字段进行关联查询 例如,下面的示例,用户表中有个字段friend标记其朋友关系,要求找出id=2及他的朋友(父节点) mysql ...

  7. mysql函数之九:MySql取得日期(前一天、某一天)

    取得当天: SELECT curdate(); mysql> SELECT curdate();+------------+| curdate()  |+------------+| 2013- ...

  8. 微信公众平台:微信JS-SDK Demo

    ylbtech-微信公众平台:微信JS-SDK Demo 1. HTML返回顶部 1.demo.html <!DOCTYPE html> <html> <head> ...

  9. PHP开发api接口 -- 安全验证 生成签名

    转载博客 ————. http://blog.csdn.net/li741350149/article/details/62887524 REST模式中HTTP请求方法(GET,POST,PUT,DE ...

  10. Asset Catalog Help (三)---Adding Image Sets

    Adding Image Sets Organize versions of your images in image sets, which you can add to an asset cata ...