亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? setcharacterencodingfilter.java

?? java servlet著名論壇源代碼
?? JAVA
字號:
/*
 * $Header: /cvsroot/mvnforum/myvietnam/src/net/myvietnam/mvncore/servlet/filter/SetCharacterEncodingFilter.java,v 1.2 2004/06/27 01:20:34 skoehler Exp $
 * $Revision: 1.2 $
 * $Date: 2004/06/27 01:20:34 $
 *
 * ====================================================================
 *
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowlegement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowlegement may appear in the software itself,
 *    if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * [Additional notices, if required by prior licensing conditions]
 *
 */


package net.myvietnam.mvncore.servlet.filter;


import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;


/**
 * <p>Example filter that sets the character encoding to be used in parsing the
 * incoming request, either unconditionally or only if the client did not
 * specify a character encoding.  Configuration of this filter is based on
 * the following initialization parameters:</p>
 * <ul>
 * <li><strong>encoding</strong> - The character encoding to be configured
 *     for this request, either conditionally or unconditionally based on
 *     the <code>ignore</code> initialization parameter.  This parameter
 *     is required, so there is no default.</li>
 * <li><strong>ignore</strong> - If set to "true", any character encoding
 *     specified by the client is ignored, and the value returned by the
 *     <code>selectEncoding()</code> method is set.  If set to "false,
 *     <code>selectEncoding()</code> is called <strong>only</strong> if the
 *     client has not already specified an encoding.  By default, this
 *     parameter is set to "true".</li>
 * </ul>
 *
 * <p>Although this filter can be used unchanged, it is also easy to
 * subclass it and make the <code>selectEncoding()</code> method more
 * intelligent about what encoding to choose, based on characteristics of
 * the incoming request (such as the values of the <code>Accept-Language</code>
 * and <code>User-Agent</code> headers, or a value stashed in the current
 * user's session.</p>
 *
 * @author Craig McClanahan
 * @version $Revision: 1.2 $ $Date: 2004/06/27 01:20:34 $
 */

public class SetCharacterEncodingFilter implements Filter {


    // ----------------------------------------------------- Instance Variables


    /**
     * The default character encoding to set for requests that pass through
     * this filter.
     */
    protected String encoding = null;


    /**
     * The filter configuration object we are associated with.  If this value
     * is null, this filter instance is not currently configured.
     */
    protected FilterConfig filterConfig = null;


    /**
     * Should a character encoding specified by the client be ignored?
     */
    protected boolean ignore = true;


    // --------------------------------------------------------- Public Methods


    /**
     * Take this filter out of service.
     */
    public void destroy() {

        this.encoding = null;
        this.filterConfig = null;

    }


    /**
     * Select and set (if specified) the character encoding to be used to
     * interpret request parameters for this request.
     *
     * @param request The servlet request we are processing
     * @param response The servlet response we are creating
     * @param chain The filter chain we are processing
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet error occurs
     */
    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain)
    throws IOException, ServletException {

        // Conditionally select and set the character encoding to be used
        if (ignore || (request.getCharacterEncoding() == null)) {
            String encoding = selectEncoding(request);
            if (encoding != null) {
                request.setCharacterEncoding(encoding);
            }
        }

        // Pass control on to the next filter
        chain.doFilter(request, response);

    }


    /**
     * Place this filter into service.
     *
     * @param filterConfig The filter configuration object
     */
    public void init(FilterConfig filterConfig) throws ServletException {

        this.filterConfig = filterConfig;
        this.encoding = filterConfig.getInitParameter("encoding");
        String value = filterConfig.getInitParameter("ignore");

        // minhnn begin
        if (this.encoding != null && this.encoding.equals("")) {
            // do not allow empty encoding
            this.encoding = null;
        }
        // minhnn end

        if (value == null)
            this.ignore = true;

        // minhnn begin
        else if (value.equals(""))
            this.ignore = true;
        // minhnn end

        else if (value.equalsIgnoreCase("true"))
            this.ignore = true;
        else if (value.equalsIgnoreCase("yes"))
            this.ignore = true;
        else
            this.ignore = false;

    }


    // ------------------------------------------------------ Protected Methods


    /**
     * Select an appropriate character encoding to be used, based on the
     * characteristics of the current request and/or filter initialization
     * parameters.  If no character encoding should be set, return
     * <code>null</code>.
     * <p>
     * The default implementation unconditionally returns the value configured
     * by the <strong>encoding</strong> initialization parameter for this
     * filter.
     *
     * @param request The servlet request we are processing
     */
    protected String selectEncoding(ServletRequest request) {

        return (this.encoding);

    }


}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美mv和日韩mv的网站| 欧美日本免费一区二区三区| 精品国偷自产国产一区| 亚洲国产婷婷综合在线精品| 成人动漫精品一区二区| 日韩女优制服丝袜电影| 亚洲精品视频自拍| 99久久99久久久精品齐齐| 久久美女高清视频| 精品在线亚洲视频| av电影在线观看完整版一区二区| 99国产精品视频免费观看| 在线播放一区二区三区| 国产精品成人一区二区艾草| 精品在线一区二区| 欧美一区二区三区在线视频 | 伊人夜夜躁av伊人久久| 国产美女在线观看一区| 欧美成va人片在线观看| 亚洲一区二区三区中文字幕| 在线视频综合导航| 欧美一级专区免费大片| 亚洲一区二区三区中文字幕在线| 国产午夜精品一区二区| 午夜精品久久久久久久99水蜜桃| 欧美在线一二三四区| 亚洲在线观看免费视频| 日韩精品一区二| 97久久精品人人爽人人爽蜜臀| 亚洲高清一区二区三区| 久久综合视频网| 在线观看免费视频综合| 久久超碰97中文字幕| 国产精品天天看| 在线一区二区三区四区五区| 麻豆精品在线观看| 国产精品成人在线观看| 91精品国产乱码| 91网上在线视频| 国产精品一区二区三区乱码| 一区二区三区在线免费| 国产日韩欧美综合一区| 欧美一区在线视频| 色综合久久综合网97色综合 | 91精品国产91久久综合桃花| 大白屁股一区二区视频| 国产美女主播视频一区| 狠狠色狠狠色合久久伊人| 一区二区三区在线高清| 国产精品久久久久三级| 精品少妇一区二区三区在线播放 | 亚洲精品国产视频| ...av二区三区久久精品| 日韩一区二区三区精品视频 | 国产一区二区三区免费播放| 亚洲成av人片在www色猫咪| 亚洲国产成人私人影院tom| 日韩欧美你懂的| 日韩三级高清在线| 欧美精品xxxxbbbb| 91精品婷婷国产综合久久性色| 欧美三区免费完整视频在线观看| 91九色02白丝porn| 91精品国产一区二区三区香蕉| 欧美一级在线免费| 亚洲国产成人自拍| 亚洲国产精品影院| 亚洲影视在线播放| 亚洲男女一区二区三区| 午夜不卡av在线| 国产一区二区三区最好精华液| 国产一区二区三区在线看麻豆| 粉嫩绯色av一区二区在线观看| www.欧美色图| 欧美日韩国产高清一区二区 | 波多野洁衣一区| 欧美理论片在线| 国产精品久久久久久久久免费丝袜| 国产日产精品1区| 亚洲美女少妇撒尿| 日本欧美大码aⅴ在线播放| 国产精品一卡二| 91麻豆高清视频| 久久久激情视频| 三级影片在线观看欧美日韩一区二区| 黑人巨大精品欧美一区| 欧美图片一区二区三区| 久久久九九九九| 亚洲一区中文日韩| 成人午夜看片网址| 欧美www视频| 日本美女一区二区三区视频| 在线观看91精品国产入口| 久久女同性恋中文字幕| 午夜精品久久久久久久久久| 欧美日韩精品电影| 国产精品久久久一本精品| 日本不卡中文字幕| 91丨porny丨国产入口| 久久久久久久久久久久久久久99 | 日韩精品一卡二卡三卡四卡无卡| 国产经典欧美精品| 欧美大片免费久久精品三p| 五月天欧美精品| 色999日韩国产欧美一区二区| 日韩午夜在线影院| 麻豆一区二区三区| 欧美成人官网二区| 乱中年女人伦av一区二区| 欧美日韩一区高清| 麻豆精品精品国产自在97香蕉| 欧美在线999| 亚洲午夜激情网站| 欧美四级电影在线观看| 亚洲国产一区二区三区| 69av一区二区三区| 日韩激情中文字幕| 精品国产电影一区二区| 国产一区二区三区免费在线观看 | 国产精一品亚洲二区在线视频| 久久久高清一区二区三区| 国产成人在线影院| 亚洲激情五月婷婷| 日韩一区二区三区四区五区六区| 久久99久国产精品黄毛片色诱| 国产精品丝袜久久久久久app| 91精品办公室少妇高潮对白| 亚洲韩国一区二区三区| 91精品免费观看| 国产精品亚洲第一| 五月天欧美精品| 国产精品久99| 欧美麻豆精品久久久久久| 亚洲电影第三页| 一区在线中文字幕| 日韩精品在线一区| 精品视频在线免费观看| 成人国产精品视频| 免费高清在线一区| 国产精品天天看| 欧美一区二区女人| 欧美在线看片a免费观看| 久久99最新地址| 亚洲成年人网站在线观看| 中文字幕日韩一区| 久久精品视频在线免费观看 | 国产一区激情在线| 日韩国产高清影视| 爽爽淫人综合网网站| 亚洲乱码中文字幕| 亚洲日本在线天堂| 国产精品美女一区二区三区| 精品日韩一区二区| 日韩欧美国产一区在线观看| 欧美日韩精品一区二区在线播放| 9191久久久久久久久久久| 欧美日韩国产经典色站一区二区三区 | 国产精品久久久久影院老司| 精品成人在线观看| www日韩大片| 亚洲国产精品高清| 亚洲国产高清在线| 日本一区二区三区dvd视频在线| 久久这里只有精品首页| 久久精品免费在线观看| 欧美国产激情一区二区三区蜜月| 中文字幕精品综合| 亚洲午夜电影在线观看| 麻豆中文一区二区| 91麻豆成人久久精品二区三区| 欧美午夜精品一区| 欧美人狂配大交3d怪物一区| 欧美日韩高清一区二区不卡| 国产精品狼人久久影院观看方式| 亚洲人妖av一区二区| 午夜精品久久久久久久99水蜜桃 | 亚洲视频一区在线| 天天综合网天天综合色| 国产精品综合一区二区三区| 在线这里只有精品| 欧美一区二区国产| 精品影视av免费| 一本到不卡免费一区二区| 欧美一区二区三区免费观看视频| 亚洲国产精品99久久久久久久久| 午夜久久久影院| 大白屁股一区二区视频| 91精品国产综合久久久久久久久久| 中日韩av电影| 国产真实乱偷精品视频免| 色综合咪咪久久| 国产精品欧美极品| 精品亚洲国内自在自线福利| aaa亚洲精品| 精品免费视频一区二区| 亚洲国产成人va在线观看天堂| 懂色av中文字幕一区二区三区| 欧美疯狂性受xxxxx喷水图片| 国产精品嫩草99a| 国产成人精品三级麻豆|