- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
actioncontext和servletactioncontext小结(Actioncontext and servletactioncontext nodules)
actioncontext和servletactioncontext小结(Actioncontext and servletactioncontext nodules)
1. ActionContext
In Struts2 development, in addition to the request parameters are automatically set to the Action field, we often need direct access request in the Action (Request) or session (Session) some of the information, or even directly on the JavaServlet Http request (HttpServletRequest), response (HttpServletResponse) operation. We need to get a request request parameters the value for username in Action:
ActionContext = ActionContext.getContext (context);
Map = context.getParameters (params);
String = username (String) params.get (username);
ActionContext (com.opensymphony.xwork.ActionContext) Action execution context, context can be seen as a container (in fact, the container here is an Map only), it is stored in the Action need to use the object in the implementation. In general, our ActionContext is through: ActionContext = context (ActionContext) (actionContext.get); to get here. Lets look at creating actionContext objects:
Static ThreadLocal actionContext = new (ActionContextThreadLocal);
ActionContextThreadLocal is a kind of internal.ThreadLocal ThreadLocal can be named threadlocals, it is every one of the variables using the thread to provide a copy of a variable value, so that each thread can be changed independently its own copy, copy and not collide with other threads. In this way, we the ActionContext attribute can only in corresponding to the current request thread visible, to ensure that it is thread safe.
HttpSession: Map session = ActionContext.getContext (.GetSession) (by ActionContext);
2. ServletActionContext
ServletActionContext (com.opensymphony.webwork. ServletActionContext), the class directly inherited we introduced above ActionContext, it provides directly associated with the Servlet object access function, it can achieve the object:
Javax.servlet.http.HttpServletRequest (1): HTTPservlet request object
Javax.servlet.http.HttpServletResponse (2): HT
您可能关注的文档
- 2014年广东省普通高校专插本考试教材-大学语文教材+考试卷答案(In 2014, colleges and universities in Guangdong specialized in teaching materials - College Chinese teaching materials + examination volume answers).doc
- 2014年上半年管理心理学第一,二次作业09(In the first half of 2014, management psychology worked first, second times, 09).doc
- 2014年抚顺高考理综全年复习计划-抚顺百特教育(2014 Fushun college entrance examination annual review plan - Fushun better education).doc
- 2014年教师资格考试中学教育学同步训练教育目的(Concurrent training of secondary studies in teacher qualification examinations in 2014 educational purpose).doc
- 2014年春季一年级下册数学期末试卷分析(Analysis in the spring of 2014 the first grade mathematics papers at the end of 2).doc
- 2014年春季幼儿园小班下学期教学计划__20150304_193542(Teaching plan for kindergarten class next semester in spring 2014 __20150304_193542).doc
- 2014年春季浙江省宁波余姚市教师资格认定公告(2014 spring, Zhejiang, Ningbo, Yuyao teacher qualification announcement).doc
- 2014年木门十大品牌最新排行(2014 wooden doors ten brands of the latest ranking).doc
- 2014年山东省烟台海阳市教师资格认定公告(Announcement on Accreditation of teachers in Shandong, Yantai, Haiyang in 2014).doc
- 2014年秋季学期少先队工作总结_20150114_100315(Summary of the work of young pioneers in the fall semester of 2014 _20150114_100315).doc
- access课后习题答案 - 副本(Access after-school exercise answers - copy).doc
- activex简介(ActiveX简介).doc
- adobe photoshop cs5 系统要求(PS图象处理软件系统要求Adobe CS5).doc
- ado简介及语法vba(Ado简介及语法vba).doc
- adsl宽带上网提速新法 从upnp功能着眼(ADSL broadband Internet speed up new law, from the UPnP features).doc
- actionscript 30系列教程1与flash9先来一次亲密接触!(ActionScript 30 Tutorial Series 1 first contact with flash9!).doc
- ac计算算法(AC computing algorithm).doc
- ailurus日积月累(Ailurus日积月累).doc
- after effect(后效应).doc
- adzs-hpusb-ice原厂仿真器[支持adi全系列dsp](Adzs-hpusb-ice original factory simulator [support for ADI full range dsp]).doc
文档评论(0)