<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    老妖的博客
    現實的中沒有幾個人能夠真為對方去死,甚至山盟海誓很快就會在金錢面前變的微不足道,這才是生活。沒有永遠的愛,除了你的父母對你,當然也就沒有永遠的恨,更沒有永遠的痛,時間是最好的治療大師,它會很快撫平你心靈上累累的傷痕。很多年以后你想起來時,那些在你生命中洶涌來往的人群至多是個模糊的影子或者毫無意義的名字
    posts - 105,  comments - 171,  trackbacks - 0
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" " http://java.sun.com/dtd/web-app_2_3.dtd ">
     
    <web-app>
     
        
    <filter>
            
    <filter-name>sitemesh</filter-name>
            
    <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> 
        
    </filter>
     
        
    <filter-mapping>
            
    <filter-name>sitemesh</filter-name>
            
    <url-pattern>/*</url-pattern>
        
    </filter-mapping>
     
    <filter> 
      
    <filter-name>encodingFilter</filter-name>
      
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
      
    <init-param>
       
    <param-name>encoding</param-name> 
       
    <param-value>UTF-8</param-value>
      
    </init-param>
      
    <init-param>
       
    <param-name>forceEncoding</param-name>
       
    <param-value>true</param-value>
      
    </init-param> 
     
    </filter>
      
    <filter-mapping>
      
    <filter-name>encodingFilter</filter-name>
      
    <url-pattern>*.jsp</url-pattern>
     
    </filter-mapping>
    </web-app>
    sitemesh.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <sitemesh>
        
    <property name="decorators-file" value="/WEB-INF/decorators.xml"/> 
        
    <excludes file="${decorators-file}"/> 
        
    <page-parsers>
            
    <parser default="true" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
            
    <parser content-type="text/html" class=" com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
            
    <parser content-type="text/html;charset=UTF-8" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
        
    </page-parsers> 
     
        
    <decorator-mappers>
            
    <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
                
    <param name="config" value="${decorators-file}"/> 
            
    </mapper>
        
    </decorator-mappers>
    </sitemesh>
    decorators.xml:
    <?xml version="1.0" encoding="utf-8"?>
     
    <decorators defaultdir="/decorators">
        
    <decorator name="main" page="test.jsp">
            
    <pattern>/*</pattern>
        
    </decorator>
     
        
    <decorator name="panel" page="panel.jsp"/>
        
    <decorator name="printable" page="printable.jsp"/>
    </decorators> 
    decorator的頁面test.jsp:
    <%@ page contentType="text/html; charset=utf-8"%>
    <%@ taglib uri=" http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
    <%@ taglib uri=" http://www.opensymphony.com/sitemesh/page" prefix="page" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml ">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><decorator:title default="Mysterious page" /></title> 
    <decorator:head />
    </head>
     
    <body>
    <table width="100%" height="100%" border="0">
      
    <tr>
        
    <td width="29%"></td>
        
    <td width="71%">&nbsp;哈哈 哈哈 
         
    </td>
      
    </tr>
      
    <tr>
        
    <td><decorator:body /></td>
        
    <td>&nbsp;</td>
      
    </tr>
    </table>
    </body>
    </html> 
    被裝飾器頁面1.jsp:
    <%@ page contentType="text/html;charset=utf-8"%>
    <html>
        
    <head>
        
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">  
        
    <title>哈哈</title>
        
    </head>        
        
    <body>
            
    <h2>哈哈</h2>
        
    </body>
    </html>
    作業環境:
    weblogic sp 5
    spring 1.2.6
    sitemesh 2.2.1
    發現有中文亂碼問題。

    在google上查找很久都沒有方法解決,后懷疑是處理編碼的org.springframework.web.filter.CharacterEncodingFilter中的代碼中只對request做了編碼處理而沒有對response做編碼處理
    自己對其做了一點小的修改紅色字部分
    protected void doFilterInternal(
                HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
                
    throws ServletException, IOException {
            
    super.doFilter(request,response,filterChain);
            
            
    if (this.forceEncoding || request.getCharacterEncoding() == null) {
                request.setCharacterEncoding(
    this.encoding);
                response.setContentType(
    "text/html; charset="+this.encoding);
            }
            filterChain.doFilter(request, response);
        }
    解決亂碼問題
    posted on 2005-12-18 12:39 老妖 閱讀(3890) 評論(0)  編輯  收藏 所屬分類: java心得spring

    <2005年12月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    隨筆分類(48)

    隨筆檔案(104)

    好友鏈接

    我的豆瓣

    積分與排名

    • 積分 - 220835
    • 排名 - 257

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 日韩免费在线中文字幕| 久久久久免费精品国产小说| 亚洲人成无码久久电影网站| 日本免费中文字幕| 亚洲综合av一区二区三区| 国产成人99久久亚洲综合精品 | 国产精品99久久免费观看| 亚洲Av无码一区二区二三区| 免费大片在线观看网站| 午夜无码A级毛片免费视频| 午夜亚洲WWW湿好爽| 久久精品夜色国产亚洲av| 日韩高清免费在线观看| 天黑黑影院在线观看视频高清免费 | 2022年亚洲午夜一区二区福利| 在线免费观看污网站| 中文字幕无码免费久久9一区9| 亚洲伦理中文字幕| 丝袜熟女国偷自产中文字幕亚洲| 国产91色综合久久免费| 一区二区三区在线免费观看视频 | 久久亚洲AV无码西西人体| 无码国产精品一区二区免费| 国产99久久久久久免费看| 亚洲中文无码mv| 亚洲AV无码专区国产乱码4SE| 四虎影视免费永久在线观看| 久久久久久精品免费免费自慰| 一级中文字幕乱码免费| 国产 亚洲 中文在线 字幕 | 亚洲av无码专区亚洲av不卡| 亚洲国产综合专区在线电影| 久久精品国产亚洲5555| 精品久久久久久久免费人妻 | 免费下载成人电影| 久久久久久影院久久久久免费精品国产小说 | 国产aⅴ无码专区亚洲av麻豆| 免费高清小黄站在线观看| 24小时日本韩国高清免费| 免费网站观看WWW在线观看| 五月婷婷免费视频|