首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Struts2 Action标签跟Tomcat启动速度慢(二)

2012-10-18 
Struts2 Action标签和Tomcat启动速度慢(二)这几天在混日记,很痛苦,前几天就把上个问题解决了,现在写出来。j

Struts2 Action标签和Tomcat启动速度慢(二)
这几天在混日记,很痛苦,前几天就把上个问题解决了,现在写出来。
jsp的内置对象还记得吗?一共有九个。现在要用的是:request。
在Action中这样写:

@SuppressWarnings("unchecked")public String FindProductsType() throws Exception{String modelId="3";String nametype;if(this.nametype==null){nametype=ActionContext.getContext().getSession().get("name").toString();}else{nametype=ActionContext.getContext().getSession().put("name", this.nametype).toString();}Map request=(Map)ActionContext.getContext().get("request");request.put("list", service2.findName(modelId));pageBean=service.queryForPageToUser(3, page, nametype);request.put("pageBeanList", pageBean);return "findproductstype";}

jsp页面:
<s:property value="#request.pageBeanList"/>

反正意思就是这样,在Action中没有把值放到内置对象里面,然后再jsp页面时肯定取不出来的,在struts2中它是把这些东西都封装好了。

热点排行