Rising Sun
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
::
148 隨筆 :: 0 文章 :: 22 評論 :: 0 Trackbacks
<
2009年8月
>
日
一
二
三
四
五
六
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(10)
給我留言
查看公開留言
查看私人留言
隨筆分類
cpp(3)
(rss)
css(6)
(rss)
hibernate+struts+spring(3)
(rss)
javascript(9)
(rss)
Lucene(3)
(rss)
oracle 數據庫(6)
(rss)
云計算(4)
(rss)
其它(6)
(rss)
處理Excel poi(6)
(rss)
學習總結(15)
(rss)
環境設置(2)
(rss)
隨筆檔案
2015年1月 (3)
2014年12月 (1)
2014年9月 (1)
2014年6月 (2)
2014年4月 (2)
2014年1月 (2)
2013年12月 (3)
2013年11月 (1)
2013年10月 (2)
2013年8月 (2)
2013年7月 (3)
2013年5月 (3)
2013年3月 (9)
2013年2月 (8)
2013年1月 (4)
2012年10月 (1)
2012年9月 (2)
2012年8月 (1)
2012年7月 (3)
2012年5月 (1)
2012年1月 (1)
2011年3月 (1)
2010年12月 (1)
2009年12月 (1)
2009年10月 (1)
2009年8月 (4)
2009年7月 (3)
2009年6月 (2)
2009年5月 (2)
2009年4月 (3)
2008年11月 (3)
2008年10月 (2)
2008年9月 (1)
2008年8月 (2)
2008年7月 (3)
2008年5月 (1)
2007年11月 (1)
2007年10月 (2)
2007年9月 (2)
2007年8月 (3)
2007年7月 (6)
2007年6月 (3)
2007年4月 (2)
2006年12月 (2)
2006年11月 (1)
2006年10月 (2)
2006年9月 (3)
2006年8月 (3)
2006年7月 (26)
2005年11月 (4)
相冊
我的相冊
java--->ajax
BlueDavy
http://www.aygfsteel.com/BlueDavy/
css
css
eamoi
搜索
最新評論
1.?re: request.getParameterValues與request.getParameter的區別:
5+5+
--5465
2.?re: 關于filter驗證用戶權限
333
--12
3.?re: Gson通過借助TypeToken獲取泛型參數的類型的方法
博主如果解決了樓上的問題 請聯系我 萬分感謝 聯系方式QQ 474233979
--yueguangxuanyuan
4.?re: Gson通過借助TypeToken獲取泛型參數的類型的方法
評論內容較長,點擊標題查看
--yueguangxuanyuan
5.?re: CMS,全稱Concurrent Low Pause Collector gc[未登錄]
很有用。非常感謝?。。?!
--匿名
閱讀排行榜
1.?Gson通過借助TypeToken獲取泛型參數的類型的方法(42682)
2.?304 Not Modified狀態碼(18909)
3.?電腦非法關機 導致ORA-01033:解決方法(9094)
4.?struts2 -- interceptor(如何配置Interceptor) (7517)
5.?MYSQL在默認的情況下查詢是不區分大小寫的(7361)
評論排行榜
1.?Gson通過借助TypeToken獲取泛型參數的類型的方法(6)
2.?Busy Developers' Guide to HSSF Features (說明書)(3)
3.?對于網上看到Window.Open()傳值(3)
4.?excel 處理 Poi(1)
5.?關于filter驗證用戶權限(1)
struts 2 request session 獲得方法
1.非Ioc方式
HttpServletRequest request1
=
ServletActionContext.getRequest();
ActionContext context
=
ActionContext.getContext();
HttpServletRequest request2
=
(HttpServletRequest).context.get(ServletActionContext.HTTP_REQUEST);
取值:
<
s:property value
=
"
#request.key
"
/>
HttpSession session1
=
ServletActionContext.getRequest().getSession();
取值:
<
s:property value
=
"
#session.key
"
/>
Map session2
=
(Map) ActionContext.getContext().get(ActionContext.SESSION);
Map session3
=
ActionContext.getContext().getSession();
取值:
<
s:property value
=
"
key
"
/>
2.IoC方式
<interceptor-ref name="defaultStack"/>配置一定要真確 不然為null
這種方式相對來說變化就比較少了,具體流程如下所示。
獲得request對象:
第一步:讓action實現ServletRequestAware接口
第二步:在action中聲明一個HttpServletRequest類型的實例變量
第三步:在action中實現ServletRequestAware接口的setServletRequest方法,實現方式很簡單,如下所示。
private
HttpServletRequest request;
publicvoid setServletRequest(HttpServletRequest request)
{
this
.request
=
request;
}
獲得Session對象(注意,此時的session是SessionMap類型):
第一步:讓action實現SessionAware接口
第二步:在action中聲明一個HttpServletRequest類型的實例變量
第三步:在action中實現SessionAware接口的setSession方法,實現方式很簡單,如下所示。
private
Map session;
publicvoid setSession(Map session)
{
this
. session
=
session;
}
本文來自CSDN博客,轉載請標明出處:http:
//
blog.csdn.net/xxxx1243/archive/2009/02/16/3896133.aspx
posted on 2009-08-20 10:32
brock
閱讀(354)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © brock
主站蜘蛛池模板:
屏南县
|
吴川市
|
忻州市
|
托克逊县
|
沙河市
|
田阳县
|
林周县
|
仙游县
|
汝南县
|
龙门县
|
蒙自县
|
乐至县
|
遂宁市
|
保康县
|
宁强县
|
武山县
|
绥宁县
|
岱山县
|
娄烦县
|
江达县
|
台前县
|
宝清县
|
肃北
|
来宾市
|
穆棱市
|
丰顺县
|
太原市
|
丰都县
|
三都
|
崇仁县
|
洛南县
|
晋城
|
当涂县
|
江陵县
|
洛扎县
|
阿克陶县
|
石家庄市
|
扶余县
|
吕梁市
|
定州市
|
绥中县
|