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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? responseutils.java

?? struts的源代碼
?? JAVA
字號:
/*
 * $Id: ResponseUtils.java 164747 2005-04-26 05:47:48Z hrabago $ 
 *
 * Copyright 1999-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.struts.util;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;

import org.apache.struts.taglib.TagUtils;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;

import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.net.URLEncoder;

/**
 * General purpose utility methods related to generating a servlet response
 * in the Struts controller framework.
 *
 * @version $Rev: 164747 $ $Date: 2005-04-26 06:47:48 +0100 (Tue, 26 Apr 2005) $
 */
public class ResponseUtils {


    // ------------------------------------------------------- Static Variables


    /**
     * The message resources for this package.
     */
    protected static MessageResources messages =
        MessageResources.getMessageResources
        ("org.apache.struts.util.LocalStrings");


    /**
     * Java 1.4 encode method to use instead of deprecated 1.3 version.
     */
    private static Method encode = null;


    /**
     * Commons logging instance.
     */
    private static final Log log = LogFactory.getLog(ResponseUtils.class);


    /**
     * Initialize the encode variable with the
     * Java 1.4 method if available.
     */
    static {

        try {
            // get version of encode method with two String args
            Class[] args = new Class[]{String.class, String.class};
            encode = URLEncoder.class.getMethod("encode", args);
        } catch (NoSuchMethodException e) {
            log.debug("Could not find Java 1.4 encode method.  Using deprecated version.", e);
        }
    }

    

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


    /**
     * Filter the specified string for characters that are sensitive to
     * HTML interpreters, returning the string with these characters replaced
     * by the corresponding character entities.
     *
     * @param value The string to be filtered and returned
     */
    public static String filter(String value) {

        if (value == null || value.length() == 0) {
            return value;
        }

        StringBuffer result = null;
        String filtered = null;
        for (int i = 0; i < value.length(); i++) {
            filtered = null;
            switch (value.charAt(i)) {
                case '<':
                    filtered = "&lt;";
                    break;
                case '>':
                    filtered = "&gt;";
                    break;
                case '&':
                    filtered = "&amp;";
                    break;
                case '"':
                    filtered = "&quot;";
                    break;
                case '\'':
                    filtered = "&#39;";
                    break;
            }

            if (result == null) {
                if (filtered != null) {
                    result = new StringBuffer(value.length() + 50);
                    if (i > 0) {
                        result.append(value.substring(0, i));
                    }
                    result.append(filtered);
                }
            } else {
                if (filtered == null) {
                    result.append(value.charAt(i));
                } else {
                    result.append(filtered);
                }
            }
        }

        return result == null ? value : result.toString();
    }



    
    /**
	 * <p>URLencodes a string assuming the character encoding is UTF-8.</p>
	 *
	 * @param url
	 * @return String The encoded url in UTF-8
	 */
	public static String encodeURL(String url) {
		return encodeURL(url, "UTF-8");
	}

    
    /**
     * Use the new URLEncoder.encode() method from Java 1.4 if available, else
     * use the old deprecated version.  This method uses reflection to find the
     * appropriate method; if the reflection operations throw exceptions, this
     * will return the url encoded with the old URLEncoder.encode() method.
     * @param enc The character encoding the urlencode is performed on.
     * @return String The encoded url.
     */
    public static String encodeURL(String url, String enc) {
        try {

			if(enc==null || enc.length()==0){
				enc = "UTF-8";
			}

            // encode url with new 1.4 method and UTF-8 encoding
            if (encode != null) {
                return (String) encode.invoke(null, new Object[]{url,  enc});
            }

        } catch (IllegalAccessException e) {
            log.debug("Could not find Java 1.4 encode method. Using deprecated version.", e);
        } catch (InvocationTargetException e) {
            log.debug("Could not find Java 1.4 encode method. Using deprecated version.", e);
        }

        return URLEncoder.encode(url);
    }


    /**
     * Write the specified text as the response to the writer associated with
     * this page.  <strong>WARNING</strong> - If you are writing body content
     * from the <code>doAfterBody()</code> method of a custom tag class that
     * implements <code>BodyTag</code>, you should be calling
     * <code>writePrevious()</code> instead.
     *
     * @param pageContext The PageContext object for this page
     * @param text The text to be written
     *
     * @exception JspException if an input/output error occurs (already saved)
     * @deprecated use TagUtils.write() method instead.
     *      This method will be removed after Struts 1.2.
     */
    public static void write(PageContext pageContext, String text)
        throws JspException {

        TagUtils.getInstance().write(pageContext, text);

    }


    /**
     * Write the specified text as the response to the writer associated with
     * the body content for the tag within which we are currently nested.
     *
     * @param pageContext The PageContext object for this page
     * @param text The text to be written
     *
     * @exception JspException if an input/output error occurs (already saved)
     * @deprecated use TagUtils.writePrevious() method instead.  
     *      This method will be removed after Struts 1.2.
     */
    public static void writePrevious(PageContext pageContext, String text)
        throws JspException {

        TagUtils.getInstance().writePrevious(pageContext, text);

    }


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天堂久久一区二区三区| 91在线播放网址| 精品美女在线播放| 色综合天天性综合| 国产亚洲欧美日韩在线一区| 日本大香伊一区二区三区| 国产精品视频第一区| 久久精品国产久精国产| 亚洲欧美区自拍先锋| 欧美精品一区二区在线播放| 欧美日韩和欧美的一区二区| 国产精品一色哟哟哟| 国产精品18久久久久久久网站| 香蕉影视欧美成人| 亚洲日本电影在线| 亚洲欧美电影院| 国产精品久久久久一区二区三区| 欧美乱熟臀69xxxxxx| caoporm超碰国产精品| 美洲天堂一区二卡三卡四卡视频| 午夜国产精品一区| 亚洲一区二区三区影院| 亚洲三级在线免费| 国产精品第五页| 中文字幕一区二区三区在线播放| 国产亚洲精久久久久久| 久久精品视频网| 中文字幕va一区二区三区| 石原莉奈在线亚洲二区| 三级久久三级久久久| 日本不卡一区二区三区| 三级成人在线视频| 亚洲综合成人在线视频| 亚洲成人先锋电影| 亚洲aaa精品| 亚洲一级在线观看| 欧美mv和日韩mv的网站| 久久精品国产精品亚洲红杏| 国产一区二区在线电影| 成人理论电影网| 久久aⅴ国产欧美74aaa| 狠狠色狠狠色综合系列| 懂色中文一区二区在线播放| 国产成人精品一区二区三区四区| 成人高清视频免费观看| 在线免费亚洲电影| 欧美va亚洲va在线观看蝴蝶网| 337p日本欧洲亚洲大胆色噜噜| 国产欧美va欧美不卡在线| 亚洲女子a中天字幕| 日韩一区二区不卡| 中文字幕日韩av资源站| 亚洲午夜一区二区| 久久精品国内一区二区三区| 成人午夜免费av| 色94色欧美sute亚洲线路一ni | 久久先锋影音av| 国产精品久久久久影院| 自拍视频在线观看一区二区| 日本sm残虐另类| 91网址在线看| 欧美性三三影院| 26uuu色噜噜精品一区| 欧美午夜精品久久久| 2021国产精品久久精品| 一区二区三区精品在线观看| 美日韩黄色大片| 欧洲激情一区二区| 中文字幕一区二区三中文字幕| 天堂av在线一区| 色偷偷久久一区二区三区| 国产欧美一区二区三区在线看蜜臀| 亚洲v日本v欧美v久久精品| 色哦色哦哦色天天综合| 国产精品久久久久一区二区三区共 | 大尺度一区二区| 日韩手机在线导航| 亚洲午夜一区二区| 色综合天天综合色综合av| 国产精品欧美一区喷水| 国产精品影视网| 国产日本亚洲高清| 精品一区二区三区免费观看| 欧洲人成人精品| 亚洲一二三级电影| 欧美三级在线看| 亚洲高清不卡在线观看| 欧美午夜精品一区二区蜜桃| 一区二区在线观看免费| 色婷婷久久久综合中文字幕| 一色屋精品亚洲香蕉网站| youjizz国产精品| ㊣最新国产の精品bt伙计久久| 99久久婷婷国产综合精品电影| 日韩毛片一二三区| 91福利在线观看| 亚洲国产wwwccc36天堂| 欧美性视频一区二区三区| 一区二区三区四区不卡视频| 色88888久久久久久影院野外| 亚洲欧美二区三区| 91精品福利在线| 亚洲视频资源在线| 91免费看视频| 欧美久久婷婷综合色| 日韩一区二区三区免费观看| 视频在线观看91| 日韩一卡二卡三卡四卡| 国精产品一区一区三区mba视频| 日韩欧美中文一区二区| 日本成人在线不卡视频| 久久综合狠狠综合| 91丨porny丨国产入口| 亚洲成va人在线观看| www国产精品av| 91在线国产福利| 麻豆国产精品一区二区三区| 国产欧美精品区一区二区三区 | 91美女片黄在线| 天堂va蜜桃一区二区三区| 国产人成亚洲第一网站在线播放| 成人国产精品免费观看视频| 亚洲成人av在线电影| 2020日本不卡一区二区视频| 91黄视频在线观看| 国产麻豆午夜三级精品| 亚洲黄色小视频| 久久蜜桃av一区精品变态类天堂| 色哟哟欧美精品| 国产成人日日夜夜| 亚洲综合丁香婷婷六月香| 日韩免费在线观看| 欧洲av一区二区嗯嗯嗯啊| 国产精品99久久久久久宅男| 亚洲午夜久久久| 中文字幕va一区二区三区| 欧美在线观看18| 91丨porny丨最新| 国内精品在线播放| 五月婷婷综合网| 亚洲高清中文字幕| 亚洲精品五月天| 亚洲日本一区二区三区| 中文字幕一区视频| 国产精品素人视频| 国产午夜精品久久久久久久| 久久伊人中文字幕| 精品国产91乱码一区二区三区| 欧美一级欧美三级| 欧美一二三四在线| 欧美一区二区三区在| 91精品啪在线观看国产60岁| 欧美日韩三级一区| 欧美日韩激情一区二区| 欧美老肥妇做.爰bbww| 欧美亚洲一区二区在线| 欧美特级限制片免费在线观看| 日本高清视频一区二区| 色综合久久99| 欧美在线观看视频在线| 欧美性视频一区二区三区| 欧美日韩一区二区三区高清| 9191久久久久久久久久久| 欧美一区午夜视频在线观看| 日韩欧美黄色影院| 欧美精品一区二区久久久| 久久久久国产精品麻豆ai换脸| 国产免费观看久久| 中文字幕一区不卡| 亚洲欧美日韩中文播放| 亚洲尤物视频在线| 五月激情综合色| 奇米影视在线99精品| 亚洲一级电影视频| 最新国产精品久久精品| 中文字幕视频一区二区三区久| 另类欧美日韩国产在线| 国产a精品视频| 国产69精品久久777的优势| 日本免费新一区视频| 国产 欧美在线| 国产伦精品一区二区三区视频青涩 | 亚洲制服丝袜av| 亚洲综合图片区| 亚洲欧洲另类国产综合| 中文字幕一区二区三区在线播放| 666欧美在线视频| 精品国产一二三区| 日韩欧美国产麻豆| 久久精品网站免费观看| 在线观看免费一区| 日本黄色一区二区| 欧美一区二区三区色| 欧美色窝79yyyycom| 久久亚洲一区二区三区明星换脸| 91精品国产欧美一区二区18| 中文字幕成人在线观看| 日本久久精品电影| 欧美一区二区视频在线观看| 欧美一区二区视频网站|