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

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

?? tagutils.java

?? struts的源代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * $Id: TagUtils.java 384235 2006-03-08 15:18:11Z niallp $
 *
 * Copyright 1999-2006 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.taglib;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyContent;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.config.ForwardConfig;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.taglib.html.Constants;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.ModuleUtils;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;

/**
 * Provides helper methods for JSP tags.
 *
 * @version $Rev: 384235 $
 * @since Struts 1.2
 */
public class TagUtils {

    /**
     * The Singleton instance.
     */
    private static final TagUtils instance = new TagUtils();

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

    /**
     * The message resources for this package.
     * TODO We need to move the relevant messages out of this properties file.
     */
    private static final MessageResources messages =
            MessageResources.getMessageResources("org.apache.struts.taglib.LocalStrings");

    /**
     * Maps lowercase JSP scope names to their PageContext integer constant
     * values.
     */
    private static final Map scopes = new HashMap();

    /**
     * Initialize the scope names map.
     */
    static {
        scopes.put("page", new Integer(PageContext.PAGE_SCOPE));
        scopes.put("request", new Integer(PageContext.REQUEST_SCOPE));
        scopes.put("session", new Integer(PageContext.SESSION_SCOPE));
        scopes.put("application", new Integer(PageContext.APPLICATION_SCOPE));
    }

    /**
     * Constructor for TagUtils.
     */
    protected TagUtils() {
        super();
    }

    /**
     * Returns the Singleton instance of TagUtils.
     */
    public static TagUtils getInstance() {
        return instance;
    }

    /**
     * Compute a set of query parameters that will be dynamically added to
     * a generated URL.  The returned Map is keyed by parameter name, and the
     * values are either null (no value specified), a String (single value
     * specified), or a String[] array (multiple values specified).  Parameter
     * names correspond to the corresponding attributes of the
     * <code>&lt;html:link&gt;</code> tag.  If no query parameters are
     * identified, return <code>null</code>.
     *
     * @param pageContext PageContext we are operating in

     * @param paramId Single-value request parameter name (if any)
     * @param paramName Bean containing single-value parameter value
     * @param paramProperty Property (of bean named by <code>paramName</code>
     *  containing single-value parameter value
     * @param paramScope Scope containing bean named by
     *  <code>paramName</code>
     *
     * @param name Bean containing multi-value parameters Map (if any)
     * @param property Property (of bean named by <code>name</code>
     *  containing multi-value parameters Map
     * @param scope Scope containing bean named by
     *  <code>name</code>
     *
     * @param transaction Should we add our transaction control token?
     * @return Map of query parameters
     * @exception JspException if we cannot look up the required beans
     * @exception JspException if a class cast exception occurs on a
     *  looked-up bean or property
     */
    public Map computeParameters(
            PageContext pageContext,
            String paramId,
            String paramName,
            String paramProperty,
            String paramScope,
            String name,
            String property,
            String scope,
            boolean transaction)
            throws JspException {

        // Short circuit if no parameters are specified
        if ((paramId == null) && (name == null) && !transaction) {
            return (null);
        }

        // Locate the Map containing our multi-value parameters map
        Map map = null;
        try {
            if (name != null) {
                map =
                        (Map) TagUtils.getInstance().lookup(
                                pageContext,
                                name,
                                property,
                                scope);
            }
        } catch (ClassCastException e) {
            saveException(pageContext, e);
            throw new JspException(
                    messages.getMessage("parameters.multi", name, property, scope));

        } catch (JspException e) {
            saveException(pageContext, e);
            throw e;
        }

        // Create a Map to contain our results from the multi-value parameters
        Map results = null;
        if (map != null) {
            results = new HashMap(map);
        } else {
            results = new HashMap();
        }

        // Add the single-value parameter (if any)
        if ((paramId != null) && (paramName != null)) {

            Object paramValue = null;
            try {
                paramValue =
                        TagUtils.getInstance().lookup(
                                pageContext,
                                paramName,
                                paramProperty,
                                paramScope);

            } catch (JspException e) {
                saveException(pageContext, e);
                throw e;
            }

            if (paramValue != null) {

                String paramString = null;
                if (paramValue instanceof String) {
                    paramString = (String) paramValue;
                } else {
                    paramString = paramValue.toString();
                }

                Object mapValue = results.get(paramId);
                if (mapValue == null) {
                    results.put(paramId, paramString);

                } else if (mapValue instanceof String[]) {
                    String oldValues[] = (String[]) mapValue;
                    String newValues[] = new String[oldValues.length + 1];
                    System.arraycopy(oldValues, 0, newValues, 0, oldValues.length);
                    newValues[oldValues.length] = paramString;
                    results.put(paramId, newValues);

                } else {
                    String newValues[] = new String[2];
                    newValues[0] = mapValue.toString();
                    newValues[1] = paramString;
                    results.put(paramId, newValues);
                }

            }

        }

        // Add our transaction control token (if requested)
        if (transaction) {
            HttpSession session = pageContext.getSession();
            String token = null;
            if (session != null) {
                token = (String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
            }

            if (token != null) {
                results.put(Constants.TOKEN_KEY, token);
            }
        }

        // Return the completed Map
        return (results);

    }

	public String computeURL(
			PageContext pageContext,
			String forward,
			String href,
			String page,
			String action,
			String module,
			Map params,
			String anchor,
			boolean redirect)
			throws MalformedURLException {
			return this.computeURLWithCharEncoding(
								pageContext,
								forward,
								href,
								page,
								action,
								module,
								params,
								anchor,
								redirect,
								false);
	}

    /**
     * Compute a hyperlink URL based on the <code>forward</code>,
     * <code>href</code>, <code>action</code> or <code>page</code> parameter
     * that is not null.
     * The returned URL will have already been passed to
     * <code>response.encodeURL()</code> for adding a session identifier.
     *
     * @param pageContext PageContext for the tag making this call
     *
     * @param forward Logical forward name for which to look up
     *  the context-relative URI (if specified)
     * @param href URL to be utilized unmodified (if specified)
     * @param page Module-relative page for which a URL should
     *  be created (if specified)
     * @param action Logical action name for which to look up
     *  the context-relative URI (if specified)
     *
     * @param params Map of parameters to be dynamically included (if any)
     * @param anchor Anchor to be dynamically included (if any)
     *
     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?
     * @return URL with session identifier
     * @exception java.net.MalformedURLException if a URL cannot be created
     *  for the specified parameters
     */
    public String computeURLWithCharEncoding(
            PageContext pageContext,
            String forward,
            String href,
            String page,
            String action,
            String module,
            Map params,
            String anchor,
            boolean redirect,
	        boolean useLocalEncoding)
            throws MalformedURLException {

        return computeURLWithCharEncoding(
                pageContext,
                forward,
                href,
                page,
                action,
                module,
                params,
                anchor,
                redirect,
                true,
                useLocalEncoding);
    }

	public String computeURL(
			PageContext pageContext,
			String forward,
			String href,
			String page,
			String action,
			String module,
			Map params,
			String anchor,
			boolean redirect,
			boolean encodeSeparator)
			throws MalformedURLException {
				return computeURLWithCharEncoding(
				pageContext,
				forward,
				href,
				page,
				action,
				module,
				params,
				anchor,
				redirect,
				encodeSeparator,
				false
				);
	}

    /**
     * Compute a hyperlink URL based on the <code>forward</code>,
     * <code>href</code>, <code>action</code> or <code>page</code> parameter
     * that is not null.
     * The returned URL will have already been passed to
     * <code>response.encodeURL()</code> for adding a session identifier.
     *
     * @param pageContext PageContext for the tag making this call
     *
     * @param forward Logical forward name for which to look up
     *  the context-relative URI (if specified)
     * @param href URL to be utilized unmodified (if specified)
     * @param page Module-relative page for which a URL should
     *  be created (if specified)
     * @param action Logical action name for which to look up
     *  the context-relative URI (if specified)
     *
     * @param params Map of parameters to be dynamically included (if any)
     * @param anchor Anchor to be dynamically included (if any)
     *
     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?
     * @param encodeSeparator This is only checked if redirect is set to false (never
     * encoded for a redirect).  If true, query string parameter separators are encoded
     * as &gt;amp;, else &amp; is used.
     * @param useLocalEncoding If set to true, urlencoding is done on the bytes of
     * character encoding from ServletResponse#getCharacterEncoding. Use UTF-8
     * otherwise.
     * @return URL with session identifier
     * @exception java.net.MalformedURLException if a URL cannot be created
     *  for the specified parameters
     */
    public String computeURLWithCharEncoding(
            PageContext pageContext,
            String forward,
            String href,
            String page,
            String action,
            String module,
            Map params,
            String anchor,
            boolean redirect,
            boolean encodeSeparator,
            boolean useLocalEncoding)
            throws MalformedURLException {
       String charEncoding = "UTF-8";
       if(useLocalEncoding){
       	charEncoding = pageContext.getResponse().getCharacterEncoding();
       }

        // TODO All the computeURL() methods need refactoring!

        // Validate that exactly one specifier was included
        int n = 0;
        if (forward != null) {
            n++;
        }
        if (href != null) {
            n++;
        }
        if (page != null) {
            n++;
        }
        if (action != null) {
            n++;
        }
        if (n != 1) {
            throw new MalformedURLException(messages.getMessage("computeURL.specifier"));
        }

        // Look up the module configuration for this request
        ModuleConfig moduleConfig = instance.getModuleConfig(module, pageContext);

        // Calculate the appropriate URL

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产丝袜视频| 国产精品人成在线观看免费| 成人综合婷婷国产精品久久免费| 一区二区三区免费网站| 久久婷婷国产综合国色天香| 欧洲精品一区二区三区在线观看| 国产自产视频一区二区三区| 亚洲福利视频导航| 国产精品天天摸av网| 精品少妇一区二区三区在线视频| 欧美视频精品在线观看| 成人久久18免费网站麻豆| 国产在线视频不卡二| 日韩av在线播放中文字幕| 另类欧美日韩国产在线| 亚洲一区二区三区免费视频| 国产精品无人区| 久久视频一区二区| 日韩精品一区在线观看| 欧美日本高清视频在线观看| 91一区二区在线| 不卡一区在线观看| 国产高清无密码一区二区三区| 日韩高清在线一区| 亚洲高清视频在线| 一区二区三区在线免费| 国产精品不卡一区二区三区| 久久久三级国产网站| 制服视频三区第一页精品| 欧美综合一区二区| 色综合中文综合网| 久久精品av麻豆的观看方式| 亚洲电影第三页| 亚洲综合视频在线观看| 中文字幕在线一区| 中文字幕乱码久久午夜不卡| 国产午夜精品福利| 国产亚洲欧美一区在线观看| 久久伊人蜜桃av一区二区| 久久伊99综合婷婷久久伊| 欧美精品一区二区高清在线观看| 亚洲精品在线电影| 精品裸体舞一区二区三区| 精品国产乱码久久久久久久| 精品国产99国产精品| 亚洲精品一区在线观看| 久久嫩草精品久久久久| 久久精品亚洲麻豆av一区二区| 久久青草欧美一区二区三区| 久久久久久免费网| 国产精品私房写真福利视频| 中文字幕色av一区二区三区| 亚洲图片激情小说| 亚洲第四色夜色| 久久不见久久见中文字幕免费| 国产综合色精品一区二区三区| 国产一区二区美女诱惑| 福利一区在线观看| 一本到不卡免费一区二区| 在线亚洲高清视频| 日韩片之四级片| 国产三级久久久| 一区二区三区四区蜜桃| 午夜精品123| 韩国成人福利片在线播放| 国产大陆a不卡| 精品国产乱码久久久久久浪潮| 亚洲精品一区二区三区蜜桃下载 | 成人性色生活片免费看爆迷你毛片| 成人一区二区三区视频| 日本乱人伦一区| 91精品国产高清一区二区三区| 精品国产一区二区三区久久久蜜月| 国产午夜久久久久| 亚洲国产成人porn| 国产一区二区h| 欧美综合一区二区三区| 精品国产乱码久久久久久闺蜜| 国产精品初高中害羞小美女文 | 成人免费观看av| 欧美日韩免费电影| 精品国产免费一区二区三区四区 | 日韩一级黄色片| 国产精品视频麻豆| 日韩在线一二三区| 成人sese在线| 欧美精品xxxxbbbb| 国产精品美女久久久久久久久| 亚洲国产sm捆绑调教视频 | 亚洲二区在线观看| 懂色av一区二区三区蜜臀| 欧美性猛片xxxx免费看久爱| 26uuuu精品一区二区| 亚洲精品视频在线观看网站| 久久精品国产亚洲高清剧情介绍| 99视频精品在线| 精品国产sm最大网站免费看| 一区二区三区日韩欧美精品| 狠狠色丁香婷婷综合久久片| 91麻豆国产福利精品| 精品第一国产综合精品aⅴ| 亚洲综合色区另类av| 激情综合色综合久久| 欧美视频在线观看一区二区| 国产日韩精品视频一区| 免费一级欧美片在线观看| 色婷婷av一区二区三区gif| 久久久精品中文字幕麻豆发布| 亚洲国产成人91porn| av激情成人网| 国产欧美日韩精品a在线观看| 五月激情综合色| 日本高清视频一区二区| 国产精品视频免费看| 国产激情91久久精品导航| 欧美一区二区在线免费播放| 一区二区欧美视频| av影院午夜一区| 国产精品久久久久久久久免费相片 | 欧美国产日韩a欧美在线观看| 日日夜夜免费精品| 91成人国产精品| 亚洲综合在线第一页| 91丨九色丨蝌蚪丨老版| 国产精品少妇自拍| 丁香六月久久综合狠狠色| 久久天天做天天爱综合色| 精品一区二区三区在线播放| 91精品国产手机| 蜜桃在线一区二区三区| 欧美一卡二卡三卡| 热久久免费视频| 91精品国产色综合久久久蜜香臀| 亚洲成av人片在www色猫咪| 在线免费一区三区| 亚洲一线二线三线久久久| 色综合久久综合网欧美综合网| 中文字幕日韩一区| 一本久久a久久精品亚洲| 亚洲免费在线电影| 欧美亚一区二区| 水野朝阳av一区二区三区| 欧美日韩国产高清一区二区三区 | 51午夜精品国产| 七七婷婷婷婷精品国产| 精品免费99久久| 国产精品一区二区久久不卡| 欧美国产成人在线| 99视频超级精品| 亚洲午夜久久久| 欧美一级二级三级乱码| 精品亚洲欧美一区| 中文字幕欧美区| 91丝袜美腿高跟国产极品老师 | 久久疯狂做爰流白浆xx| 精品国产乱码久久久久久老虎| 国产精品一区二区不卡| 中文字幕一区二区三区在线观看 | 一级日本不卡的影视| 欧美日韩国产三级| 精品一区二区三区在线播放视频| 久久精品一区四区| 一本色道亚洲精品aⅴ| 亚洲成av人片在www色猫咪| 精品日韩欧美一区二区| 成人精品免费看| 亚瑟在线精品视频| 精品粉嫩aⅴ一区二区三区四区| 波多野结衣中文字幕一区二区三区 | 欧美日韩高清一区二区不卡| 九九精品一区二区| 亚洲视频1区2区| 欧美成人精品福利| 99精品视频免费在线观看| 午夜精品久久久久久久| 久久久九九九九| 欧美在线观看视频一区二区 | 亚洲精品欧美二区三区中文字幕| 欧美一区在线视频| 不卡一区二区三区四区| 偷窥少妇高潮呻吟av久久免费| 久久久精品国产99久久精品芒果| 色妞www精品视频| 九九热在线视频观看这里只有精品| 成人欧美一区二区三区1314| 777久久久精品| 91麻豆高清视频| 国产成人免费网站| 亚洲成a人片在线不卡一二三区| 国产日韩亚洲欧美综合| 欧美亚洲国产怡红院影院| 国产精品一区二区无线| 亚洲动漫第一页| 一区视频在线播放| 久久亚洲一区二区三区明星换脸| 欧美色图在线观看| 波多野结衣一区二区三区| 青青草成人在线观看| 亚洲人成网站影音先锋播放| 精品成人在线观看|