@Results( 中 params 怎么用
2024-09-30 01:44:35
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;
- }
最新文章
- FileSystem.DeleteDirectory遇到";无法删除 文件:无法读取源文件或磁盘";
- EasyUI需注意的问题01
- window.location.href 失效的解决办法
- 2016.1.4~2016.1.7真题回顾!-- HTML5学堂
- 从0开始学Swift笔记整理(五)
- 获得供应商最近一次报价:OVER(PARTITION BY)函数用法的实际用法
- TCP协议RST:RST介绍、什么时候发送RST包
- hdu 3535 AreYouBusy
- josscrowcroft / Simple-JavaScript-DOM-Inspector
- FusionCharts中图的属性的总结归纳
- 看懂 ,学会 .NET 事件的正确姿势-简单版
- Spring Boot 2.x 编写 RESTful API (六) 事务
- -bash: fork: Cannot allocate memory 问题的处理
- [ 随手记 2 ] C/C++ 数组/指针/传数组到函数/指针数组/数组指针
- 章节二、4-String以及StringBuffer和StringBuilder的对比
- 关于js的函数
- 【推荐】使用Ultrapico Expresso学习正则表达式
- Java的反射机制Reflect
- C51 头文件中的 extern
- Android AppCompat 需要 API 级别 11
热门文章
- 基于BASYS2的VHDL程序——交通灯(状态机版)
- 编译Thrift
- Vue表格数据增删改查及搜索
- NLP任务中的基本指标(precision and recall )
- python 基础之第九天
- 「USACO16OPEN」「LuoguP3147」262144(区间dp
- MTK UART串口调试
- 使用libvirt技术监控虚拟机资源利用情况
- SpringMVC配置字符过滤器的两种方式
- ** Error in `./g2o_viewer&#39;: realloc(): invalid pointer: