Rising Sun
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
::
148 隨筆 :: 0 文章 :: 22 評論 :: 0 Trackbacks
<
2006年7月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
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.tkk7.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獲取泛型參數的類型的方法(42693)
2.?304 Not Modified狀態碼(18911)
3.?電腦非法關機 導致ORA-01033:解決方法(9100)
4.?struts2 -- interceptor(如何配置Interceptor) (7522)
5.?MYSQL在默認的情況下查詢是不區分大小寫的(7368)
評論排行榜
1.?Gson通過借助TypeToken獲取泛型參數的類型的方法(6)
2.?Busy Developers' Guide to HSSF Features (說明書)(3)
3.?對于網上看到Window.Open()傳值(3)
4.?excel 處理 Poi(1)
5.?關于filter驗證用戶權限(1)
一個character encoding filter
?1
package?cn.com.jsp;
?2
?3
import?java.io.IOException;
?4
import?javax.servlet.Filter;
?5
import?javax.servlet.FilterChain;
?6
import?javax.servlet.FilterConfig;
?7
import?javax.servlet.ServletException;
?8
import?javax.servlet.ServletRequest;
?9
import?javax.servlet.ServletResponse;
10
import?javax.servlet.UnavailableException;
11
12
public
?
class
?SetCharacterEncodingFilter?implements?Filter?
{
13
????
protected
?String?encoding?
=
?
null
;
14
????
protected
?FilterConfig?filterConfig?
=
?
null
;
15
????
protected
?boolean?ignore?
=
?
true
;
16
17
????
public
?
void
?destroy()?
{
18
????????
this
.encoding?
=
?
null
;
19
????????
this
.filterConfig?
=
?
null
;
20
????}
21
22
????
public
?
void
?doFilter(ServletRequest?request,?ServletResponse?response,
23
?????????????????????????FilterChain?chain)?throws?IOException,
24
????????????ServletException?
{
25
26
????????
//
?Conditionally?select?and?set?the?character?encoding?to?be?used
27
????????
if
?(ignore?
||
?(request.getCharacterEncoding()?
==
?
null
))?
{
28
????????????String?encoding?
=
?selectEncoding(request);
29
????????????
if
?(encoding?
!=
?
null
)?
{
30
????????????????request.setCharacterEncoding(encoding);
31
????????????}
32
????????}
33
34
????????
//
?Pass?control?on?to?the?next?filter
35
????????chain.doFilter(request,?response);
36
37
????}
38
39
????
public
?
void
?init(FilterConfig?filterConfig)?throws?ServletException?
{
40
41
????????
this
.filterConfig?
=
?filterConfig;
42
????????
this
.encoding?
=
?filterConfig.getInitParameter(
"
encoding
"
);
43
????????String?value?
=
?filterConfig.getInitParameter(
"
ignore
"
);
44
????????
if
?(value?
==
?
null
)?
{
45
????????????
this
.ignore?
=
?
true
;
46
????????}
?
else
?
if
?(value.equalsIgnoreCase(
"
true
"
))?
{
47
????????????
this
.ignore?
=
?
true
;
48
????????}
?
else
?
if
?(value.equalsIgnoreCase(
"
yes
"
))?
{
49
????????????
this
.ignore?
=
?
true
;
50
????????}
?
else
?
{
51
????????????
this
.ignore?
=
?
false
;
52
????????}
53
54
????}
55
56
????
protected
?String?selectEncoding(ServletRequest?request)?
{
57
????????
return
?(
this
.encoding);
58
????}
59
60
}
相應的web.xml文件里的配置如下:
?1
<
web-app
>
?2
??
<
display-name
>
wwwroot
SPAN style="COLOR: #800000">display-name
>
?3
??
<
description
>
MySQL?Test?App
SPAN style="COLOR: #800000">description
>
?4
??
<
filter
>
?5
????
<
filter-name
>
setCharacterEncodingFilter
SPAN style="COLOR: #800000">filter-name
>
?6
????
<
display-name
>
setCharacterEncodingFilter
SPAN style="COLOR: #800000">display-name
>
?7
????
<
description
>
setCharacterEncodingFilter
SPAN style="COLOR: #800000">description
>
?8
????
<
filter-class
>
cn.com.jsp.SetCharacterEncodingFilter
SPAN style="COLOR: #800000">filter-class
>
?9
????
<
init-param
>
10
??????
<
param-name
>
encoding
SPAN style="COLOR: #800000">param-name
>
11
??????
<
param-value
>
GBK
SPAN style="COLOR: #800000">param-value
>
12
????
SPAN style="COLOR: #800000">init-param
>
13
??
SPAN style="COLOR: #800000">filter
>
14
??
<
filter-mapping
>
15
????
<
filter-name
>
setCharacterEncodingFilter
SPAN style="COLOR: #800000">filter-name
>
16
????
<
url-pattern
>
/*
SPAN style="COLOR: #800000">url-pattern
>
17
??
SPAN style="COLOR: #800000">filter-mapping
>
18
……
19
SPAN style="COLOR: #800000">web-app
>
上面的代碼我也沒更改什么,看了后,了解了其中的些許流程。放入blog,留以備學吧
posted on 2006-07-27 15:11
brock
閱讀(374)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © brock
主站蜘蛛池模板:
亚洲av乱码一区二区三区
|
亚洲成av人片不卡无码久久
|
亚洲AV无码不卡在线播放
|
一级看片免费视频囗交
|
亚洲卡一卡2卡三卡4麻豆
|
成人无码WWW免费视频
|
亚洲人成精品久久久久
|
一区二区三区无码视频免费福利
|
亚洲午夜久久久久久久久电影网
|
羞羞视频免费观看
|
又黄又爽一线毛片免费观看
|
亚洲av无码无在线观看红杏
|
a级毛片免费全部播放
|
亚洲AV无码国产丝袜在线观看
|
五月天婷亚洲天综合网精品偷
|
亚洲αⅴ无码乱码在线观看性色
|
国产一级一片免费播放i
|
乱淫片免费影院观看
|
亚洲性日韩精品一区二区三区
|
韩国免费A级毛片久久
|
久久精品7亚洲午夜a
|
亚洲精品国产免费
|
亚洲一日韩欧美中文字幕在线
|
国产免费卡一卡三卡乱码
|
2022免费国产精品福利在线
|
亚洲AV日韩AV天堂久久
|
无码乱肉视频免费大全合集
|
亚洲av无码专区国产不乱码
|
一区二区3区免费视频
|
亚洲男人都懂得羞羞网站
|
无码国产精品一区二区免费I6
|
亚洲国产精品无码中文lv
|
久久久久久亚洲精品不卡
|
99re6在线视频精品免费下载
|
亚洲综合偷自成人网第页色
|
日韩免费电影网址
|
亚洲免费网站在线观看
|
亚洲免费无码在线
|
1000部拍拍拍18免费网站
|
国产精品亚洲一区二区在线观看
|
老司机69精品成免费视频
|