• 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 方法)

    [java] view plain copy
     
    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")})  


    前台:

    [html] view plain copy
     
    1. <%out.println(request.getAttribute("attachMemo1")); %>  


    2、action跳转至action

    后台:(stptuser为 action中的bo)

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


    或者

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


    另一个action获取

    [java] view plain copy
     
    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 怎么用

    标签:lai   util   date   cati   rec   turn   nds   csdn   bsp   

    原文:https://www.cnblogs.com/ConfidentLiu/p/8434662.html

  • 相关阅读:
    [bzoj4408][Fjoi2016]神秘数
    BZOJ1102: [POI2007]山峰和山谷Grz
    BZOJ1098: [POI2007]办公楼biu
    BZOJ1097: [POI2007]旅游景点atr
    GDOI2018 新的征程
    BZOJ2084: [Poi2010]Antisymmetry
    回文树详解
    Codeforces739E. Gosha is hunting
    一道题17
    LOJ#6002. 「网络流 24 题」最小路径覆盖
  • 原文地址:https://www.cnblogs.com/ConfidentLiu/p/8472971.html
Copyright © 2020-2023  润新知