luckwolf
          蘇州黑心法官顧建華聯(lián)合訴訟人詐騙我52萬(wàn)
          posts - 11,  comments - 69,  trackbacks - 0

          今天碰到一個(gè)這樣的問(wèn)題,我開始用了n個(gè)原始的方法都解決不了。我就以為這過(guò)濾器中也解決不了。沒(méi)想到一試就靈,
          這也是解決jsp include 參數(shù)亂碼最有效的方式,網(wǎng)上別的方式不一定能行。

          public ? class ?MyFilter? implements ?Filter? {
          ????
          private ?FilterConfig?filterConfig;

          ????
          // ?Handle?the?passed-in?FilterConfig
          ???? public ? void ?init(FilterConfig?filterConfig)? throws ?ServletException? {
          ????????
          this .filterConfig? = ?filterConfig;
          ????}


          ????
          // ?Process?the?request/response?pair
          ???? public ? void ?doFilter(ServletRequest?request,?ServletResponse?response,
          ????????????FilterChain?filterChain)?
          {

          ????????
          try ? {
          ????????????request.setCharacterEncoding(
          " GBK " );????????????
          ????????????filterChain.doFilter(request,?response);
          ????????}
          ? catch ?(ServletException?sx)? {
          ????????????filterConfig.getServletContext().log(sx.getMessage());
          ????????}
          ? catch ?(IOException?iox)? {
          ????????????filterConfig.getServletContext().log(iox.getMessage());
          ????????}

          ????}


          ????
          // ?Clean?up?resources
          ???? public ? void ?destroy()? {
          ????}

          }

          web.xlm配置
          < filter > ?
          < filter - name > MyFilter </ filter - name > ?
          < filter - class > com.lx.MyFilter </ filter - class > ?
          </ filter > ?
          < filter - mapping > ?
          < filter - name > MyFilter </ filter - name > ?
          < url - pattern > /* </url-pattern>?
          <dispatcher>request</dispatcher>?
          </filter-mapping>
          posted on 2007-12-11 17:30 劉祥 閱讀(794) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          蘇州黑心法官顧建華聯(lián)合訴訟人詐騙我52萬(wàn)

          <2007年12月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(4)

          隨筆檔案(14)

          文章檔案(2)

          相冊(cè)

          我的友情聯(lián)接

          積分與排名

          • 積分 - 63707
          • 排名 - 836

          最新隨筆

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 吴堡县| 灌云县| 木兰县| 峡江县| 永平县| 南通市| 宁远县| 乌恰县| 陵川县| 临泉县| 渑池县| 平和县| 嘉祥县| 蓬安县| 蓬溪县| 洪雅县| 巫山县| 杭州市| 海伦市| 三都| 攀枝花市| 泽州县| 丰顺县| 翁牛特旗| 肃南| 古蔺县| 邯郸县| 阿拉尔市| 从化市| 三河市| 罗甸县| 朔州市| 万盛区| 威宁| 通化县| 万宁市| 威信县| 宣汉县| 共和县| 淳化县| 阜康市|