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

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

?? moduleutils.java

?? struts的源代碼
?? JAVA
字號:
/*
 * $Id: ModuleUtils.java 54929 2004-10-16 16:38:42Z germuska $ 
 *
 * 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.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.Globals;
import org.apache.struts.action.RequestProcessor;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.config.MessageResourcesConfig;

/**
 * General purpose utility methods related to module processing.
 * 
 * @version $Rev: 54929 $
 * @since Struts 1.2
 */
public class ModuleUtils {

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

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

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

    /**
     * Constructor for ModuleUtils.
     */
    protected ModuleUtils() {
        super();
    }
    
	/**
	 * Return the current ModuleConfig object stored in request, if it exists,
	 * null otherwise.
	 * This method can be used by plugin to retrieve the current module config
	 * object. If no moduleConfig is found, this means that the request haven't
	 * hit the server throught the struts servlet. The appropriate module config
	 * can be set and found with
	 * <code>{@link RequestUtils#selectModule(HttpServletRequest, ServletContext)} </code>.
	 * @param request The servlet request we are processing
	 * @return the ModuleConfig object from request, or null if none is set in
	 * the request.
	 */
	public ModuleConfig getModuleConfig(HttpServletRequest request) {
		return (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
	}
    
	/**
	 * Return the desired ModuleConfig object stored in context, if it exists,
	 * null otherwise.
	 * 
     * @param prefix The module prefix of the desired module
     * @param context The ServletContext for this web application
	 * @return the ModuleConfig object specified, or null if not found in
	 * the context.
	 */
	public ModuleConfig getModuleConfig(String prefix, ServletContext context) {
		return (ModuleConfig) context.getAttribute(Globals.MODULE_KEY + prefix);
	}
    
	/**
	 * Return the desired ModuleConfig object stored in context, if it exists,
	 * otherwise return the current ModuleConfig
	 * 
	 * @param prefix The module prefix of the desired module
	 * @param request The servlet request we are processing
	 * @param context The ServletContext for this web application
	 * @return the ModuleConfig object specified, or null if not found in
	 * the context.
	 */
	public ModuleConfig getModuleConfig(String prefix, HttpServletRequest request, ServletContext context) {
		ModuleConfig moduleConfig = null;
		
		
		if(prefix != null) {
			//lookup module stored with the given prefix.
			moduleConfig = this.getModuleConfig(prefix, context);
		}
		else {
			//return the current module if no prefix was supplied.
			moduleConfig = this.getModuleConfig(request, context);
		}
		return moduleConfig;
	}

    /**
     * Return the ModuleConfig object is it exists, null otherwise.
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     * @return the ModuleConfig object
     */
    public ModuleConfig getModuleConfig(
        HttpServletRequest request,
        ServletContext context) {

		ModuleConfig moduleConfig = this.getModuleConfig(request);

		if (moduleConfig == null) {
			moduleConfig = this.getModuleConfig("", context);
			request.setAttribute(Globals.MODULE_KEY, moduleConfig);
		}

		return moduleConfig;
    }


    /**
     * Get the module name to which the specified request belong.
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     * @return The module prefix or ""
     */
    public String getModuleName(
        HttpServletRequest request,
        ServletContext context) {

        // Acquire the path used to compute the module
        String matchPath =
            (String) request.getAttribute(RequestProcessor.INCLUDE_SERVLET_PATH);

        if (matchPath == null) {
            matchPath = request.getServletPath();
        }

        return this.getModuleName(matchPath, context);
    }

    /**
     * Get the module name to which the specified uri belong.
     * @param matchPath The uri from which we want the module name.
     * @param context The ServletContext for this web application
     * @return The module prefix or ""
     */
    public String getModuleName(String matchPath, ServletContext context) {
        if (log.isDebugEnabled()) {
            log.debug("Get module name for path " + matchPath);
        }

        String prefix = ""; // Initialize prefix before we try lookup
        String prefixes[] = getModulePrefixes(context);
        // Get all other possible prefixes
        int lastSlash = 0; // Initialize before loop

        while (prefix.equals("")
            && ((lastSlash = matchPath.lastIndexOf("/")) > 0)) {

            // We may be in a non-default module.  Try to get it's prefix.
            matchPath = matchPath.substring(0, lastSlash);

            // Match against the list of module prefixes
            for (int i = 0; i < prefixes.length; i++) {
                if (matchPath.equals(prefixes[i])) {
                    prefix = prefixes[i];
                    break;
                }
            }
        }

        if (log.isDebugEnabled()) {
            log.debug(
                "Module name found: " + (prefix.equals("") ? "default" : prefix));
        }

        return prefix;
    }

    /**
     * Return the list of module prefixes that are defined for
     * this web application.  <strong>NOTE</strong> -
     * the "" prefix for the default module is not included in this list.
     *
     * @param context The ServletContext for this web application.
     * @return An array of module prefixes.
     */
    public String[] getModulePrefixes(ServletContext context) {
        return (String[]) context.getAttribute(Globals.MODULE_PREFIXES_KEY);
    }

    /**
     * Select the module to which the specified request belongs, and
     * add corresponding request attributes to this request.
     *
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     */
    public void selectModule(HttpServletRequest request, ServletContext context) {
        // Compute module name
        String prefix = getModuleName(request, context);

        // Expose the resources for this module
        this.selectModule(prefix, request, context);

    }

    /**
     * Select the module to which the specified request belongs, and
     * add corresponding request attributes to this request.
     *
     * @param prefix The module prefix of the desired module
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     */
    public void selectModule(
        String prefix,
        HttpServletRequest request,
        ServletContext context) {

        // Expose the resources for this module
        ModuleConfig config = getModuleConfig(prefix, context);

        if (config != null) {
            request.setAttribute(Globals.MODULE_KEY, config);
        } else {
            request.removeAttribute(Globals.MODULE_KEY);
        }

        MessageResourcesConfig[] mrConfig = config.findMessageResourcesConfigs();
        for(int i = 0; i < mrConfig.length; i++) {
          String key = mrConfig[i].getKey();
          MessageResources resources =
            (MessageResources) context.getAttribute(key + prefix);
          if (resources != null) {
              request.setAttribute(key, resources);
          } else {
              request.removeAttribute(key);
          }
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级高清片在线观看| 国产精品亚洲人在线观看| 91久久线看在观草草青青| 轻轻草成人在线| 韩国精品一区二区| 欧美在线观看视频在线| 精品福利av导航| 中文字幕欧美区| 国产欧美日韩另类一区| 日韩视频一区二区| 91精品在线免费观看| 欧美r级在线观看| www成人在线观看| 日韩欧美自拍偷拍| 欧美经典三级视频一区二区三区| 69av一区二区三区| 欧美精品在欧美一区二区少妇| 91精品在线一区二区| 538prom精品视频线放| 日韩欧美三级在线| 国产嫩草影院久久久久| 国产精品久久久久久久蜜臀| 综合久久国产九一剧情麻豆| 美女精品自拍一二三四| 久久成人精品无人区| 欧美精品丝袜中出| 亚洲一区二区三区视频在线 | 亚洲日本在线a| 丁香激情综合国产| 91免费在线视频观看| 午夜精品福利一区二区三区av| 亚洲精品视频在线观看免费| 日韩成人精品视频| 欧美日韩国产在线观看| 国产成人免费在线观看| 欧洲av在线精品| 欧美激情在线观看视频免费| 91黄色在线观看| 久久精品99国产国产精| 亚洲欧洲成人精品av97| 欧美一区二区在线免费播放| 成人国产精品免费网站| 在线不卡a资源高清| 高清视频一区二区| 香蕉久久一区二区不卡无毒影院| 久久久亚洲午夜电影| 欧美福利电影网| 亚洲国产一二三| 国产精品三级久久久久三级| 久久久99精品免费观看不卡| 欧美日韩久久一区| 成人动漫一区二区| 狠狠色丁香久久婷婷综合丁香| 亚洲影视在线观看| 国产精品亲子乱子伦xxxx裸| 欧美xxxxx牲另类人与| 欧美三级欧美一级| 91在线免费视频观看| 国产一区二区主播在线| 秋霞国产午夜精品免费视频| 亚洲一区二区三区国产| 中文字幕在线不卡一区| 国产丝袜在线精品| 成人精品小蝌蚪| 国产麻豆精品在线观看| 免费看欧美女人艹b| 日韩和的一区二区| 一区二区三区美女| 中文字幕亚洲成人| 亚洲国产高清aⅴ视频| 久久精品欧美一区二区三区麻豆| 日韩欧美国产成人一区二区| 欧美伦理视频网站| 91精品国产综合久久小美女| 日韩精品色哟哟| 五月天激情综合网| 亚洲超丰满肉感bbw| 午夜欧美2019年伦理| 亚洲成a人v欧美综合天堂下载 | 99精品国产视频| 成人爽a毛片一区二区免费| 国产一区福利在线| 国产精品1区2区3区在线观看| 综合电影一区二区三区 | 国产精品的网站| 亚洲欧洲av在线| 亚洲视频网在线直播| 国产精品乱人伦中文| 国产精品久久久久四虎| 国产精品福利av| 一级精品视频在线观看宜春院| 欧美久久久久久久久久| 欧美一二三区在线| 日韩精品一区二区三区在线观看| 日韩精品最新网址| 欧美国产日本视频| 亚洲天堂福利av| 亚洲第一会所有码转帖| 美女脱光内衣内裤视频久久影院| 久久精品国产亚洲a| 在线中文字幕不卡| 91精选在线观看| 国产夜色精品一区二区av| 色哟哟国产精品| 欧美日韩国产系列| 精品国产自在久精品国产| 国产女人18毛片水真多成人如厕 | 日韩欧美中文字幕制服| 久久亚洲综合av| 中文字幕一区二区三区在线观看| 亚洲一区二区三区四区五区黄| 日本不卡的三区四区五区| 国产成人精品综合在线观看| 日韩精品久久久久久| 国产精华液一区二区三区| 91麻豆精品视频| 日韩欧美在线一区二区三区| 中文幕一区二区三区久久蜜桃| 亚洲综合成人在线视频| 国产一区在线观看麻豆| 日本久久电影网| 欧美成人一级视频| 亚洲精品网站在线观看| 美国三级日本三级久久99 | 亚洲婷婷在线视频| 精品国产乱码久久久久久图片| 国产精品欧美经典| 日韩二区在线观看| 成人h动漫精品一区二| 91精品一区二区三区在线观看| 国产情人综合久久777777| 亚洲国产视频a| 成人听书哪个软件好| 欧美日韩成人综合在线一区二区| 国产精品高清亚洲| 国产在线看一区| 欧美日韩成人在线| 亚洲视频在线一区观看| 国产一区二区久久| 884aa四虎影成人精品一区| ...av二区三区久久精品| 国内精品伊人久久久久影院对白| 欧美日韩精品免费| 椎名由奈av一区二区三区| 国产精品白丝jk黑袜喷水| 91精品国产综合久久小美女| 亚洲香肠在线观看| 91在线视频官网| 欧美韩国日本一区| 国产真实乱偷精品视频免| 91精品一区二区三区在线观看| 亚洲最色的网站| 99国产精品视频免费观看| 国产日韩综合av| 国模少妇一区二区三区| 欧美大白屁股肥臀xxxxxx| 婷婷中文字幕综合| 欧美羞羞免费网站| 久久网站最新地址| 人禽交欧美网站| 亚洲国产欧美在线| 日韩欧美一区二区视频| 久久精品国产免费| 国产亚洲女人久久久久毛片| 懂色av一区二区三区免费看| 亚洲欧洲另类国产综合| 欧美日韩一区成人| 丁香桃色午夜亚洲一区二区三区| 中文字幕av一区 二区| 国产精品久久久久久久久免费丝袜 | 亚洲中国最大av网站| 粉嫩欧美一区二区三区高清影视| 欧美成人官网二区| 麻豆一区二区三区| 精品国产一二三| 国内外精品视频| 久久久久久**毛片大全| 国产一区二区伦理片| 久久久久国产精品麻豆| 国产大片一区二区| 中文字幕一区二区三区在线播放 | 91老司机福利 在线| 亚洲最大成人综合| 色久综合一二码| 亚洲成人av福利| 欧美成人video| 国产不卡免费视频| 国产精品精品国产色婷婷| 99久久精品免费| 亚洲国产一区二区a毛片| 欧美一级黄色录像| 国产成人超碰人人澡人人澡| 亚洲日本在线a| 欧美一区二区视频网站| 国产福利一区二区三区在线视频| 亚洲欧洲成人精品av97| 美女mm1313爽爽久久久蜜臀| 日本一区二区高清| 欧美综合色免费| 狠狠色狠狠色综合系列|