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

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

?? definitionsutil.java

?? structs源碼
?? JAVA
字號:
/*
 * $Id: DefinitionsUtil.java 471754 2006-11-06 14:55:09Z husted $
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.tiles;

import java.lang.reflect.InvocationTargetException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.tiles.taglib.ComponentConstants;

/**
 * Utilities class for definitions factory.
 * Also define userDebugLevel property (TODO to be moved from this class ?).
 * @deprecated Use {@link TilesUtil#createDefinitionsFactory(ServletContext, DefinitionsFactoryConfig)}
 */
public class DefinitionsUtil extends TilesUtil implements ComponentConstants {

    /**
     * Commons Logging instance.
     */
    protected static Log log = LogFactory.getLog(DefinitionsUtil.class);

    /**
     * Global user defined debug level.
     * @deprecated This will be removed in a release after Struts 1.2.
     */
    public static int userDebugLevel = 0;

    /**
     * User Debug level.
     * @deprecated This will be removed in a release after Struts 1.2.
     */
    public static final int NO_DEBUG = 0;

    /**
     * Name of init property carrying debug level.
     */
    public static final String DEFINITIONS_CONFIG_USER_DEBUG_LEVEL =
        "definitions-debug";

    /**
     * Name of init property carrying factory class name.
     */
    public static final String DEFINITIONS_FACTORY_CLASSNAME =
        "definitions-factory-class";

    /**
     * Constant name used to store factory in context.
     */
    public static final String DEFINITIONS_FACTORY =
        "org.apache.struts.tiles.DEFINITIONS_FACTORY";

    /**
     * Constant name used to store definition in jsp context.
     * Used to pass definition from a Struts action to servlet forward.
     */
    public static final String ACTION_DEFINITION =
        "org.apache.struts.tiles.ACTION_DEFINITION";

    /**
     * Create Definition factory.
     * If a factory class name is provided, a factory of this class is created. Otherwise,
     * default factory is created.
     * @param classname Class name of the factory to create.
     * @param servletContext Servlet Context passed to newly created factory.
     * @param properties Map of name/property used to initialize factory configuration object.
     * @return newly created factory.
     * @throws DefinitionsFactoryException If an error occur while initializing factory
     * @deprecated Use createDefinitionsFactory(ServletContext servletContext, ServletConfig servletConfig)
     */
    public static DefinitionsFactory createDefinitionsFactory(
        ServletContext servletContext,
        Map properties,
        String classname)
        throws DefinitionsFactoryException {

        // Create config object
        DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
        // populate it from map.
        try {
            factoryConfig.populate(properties);

        } catch (Exception ex) {
            throw new DefinitionsFactoryException(
                "Error - createDefinitionsFactory : Can't populate config object from properties map",
                ex);
        }

        // Add classname
        if (classname != null)
            factoryConfig.setFactoryClassname(classname);

        // Create factory using config object
        return createDefinitionsFactory(servletContext, factoryConfig);
    }

    /**
     * Create default Definition factory.
     * @param servletContext Servlet Context passed to newly created factory.
     * @param properties Map of name/property used to initialize factory configuration object.
     * @return newly created factory of type ConfigurableDefinitionsFactory.
     * @throws DefinitionsFactoryException If an error occur while initializing factory
     */
    public static DefinitionsFactory createDefinitionsFactory(
        ServletContext servletContext,
        Map properties)
        throws DefinitionsFactoryException {

        return createDefinitionsFactory(servletContext, properties, null);
    }

    /**
     * Create Definition factory.
     * Create configuration object from servlet web.xml file, then create
     * ConfigurableDefinitionsFactory and initialized it with object.
     * <p>
     * Convenience method. Calls createDefinitionsFactory(ServletContext servletContext, DefinitionsFactoryConfig factoryConfig)
     *
     * @param servletContext Servlet Context passed to newly created factory.
     * @param servletConfig Servlet config containing parameters to be passed to factory configuration object.
     * @return newly created factory of type ConfigurableDefinitionsFactory.
     * @throws DefinitionsFactoryException If an error occur while initializing factory
     */
    public static DefinitionsFactory createDefinitionsFactory(
        ServletContext servletContext,
        ServletConfig servletConfig)
        throws DefinitionsFactoryException {

        DefinitionsFactoryConfig factoryConfig = readFactoryConfig(servletConfig);

        return createDefinitionsFactory(servletContext, factoryConfig);
    }

    /**
     * Create Definition factory.
     * Create configuration object from servlet web.xml file, then create
     * ConfigurableDefinitionsFactory and initialized it with object.
     * <p>
     * If checkIfExist is true, start by checking if factory already exist. If yes,
     * return it. If no, create a new one.
     * <p>
     * If checkIfExist is false, factory is always created.
     * <p>
     * Convenience method. Calls createDefinitionsFactory(ServletContext servletContext, DefinitionsFactoryConfig factoryConfig)
     *
     * @param servletContext Servlet Context passed to newly created factory.
     * @param servletConfig Servlet config containing parameters to be passed to factory configuration object.
     * @param checkIfExist Check if factory already exist. If true and factory exist, return it.
     * If true and factory doesn't exist, create it. If false, create it in all cases.
     * @return newly created factory of type ConfigurableDefinitionsFactory.
     * @throws DefinitionsFactoryException If an error occur while initializing factory
     */
    public static DefinitionsFactory createDefinitionsFactory(
        ServletContext servletContext,
        ServletConfig servletConfig,
        boolean checkIfExist)
        throws DefinitionsFactoryException {

        if (checkIfExist) {
            // Check if already exist in context
            DefinitionsFactory factory = getDefinitionsFactory(servletContext);
            if (factory != null)
                return factory;
        }

        return createDefinitionsFactory(servletContext, servletConfig);
    }

    /**
     * Get definition factory from appropriate servlet context.
     * @return Definitions factory or null if not found.
     * @deprecated Use {@link TilesUtil#getDefinitionsFactory(ServletRequest, ServletContext)}
     * @since 20020708
     */
    public static DefinitionsFactory getDefinitionsFactory(ServletContext servletContext) {
        return (DefinitionsFactory) servletContext.getAttribute(DEFINITIONS_FACTORY);
    }

    /**
     * Get Definition stored in jsp context by an action.
     * @return ComponentDefinition or null if not found.
     */
    public static ComponentDefinition getActionDefinition(ServletRequest request) {
        return (ComponentDefinition) request.getAttribute(ACTION_DEFINITION);
    }

    /**
     * Store definition in jsp context.
     * Mainly used by Struts to pass a definition defined in an Action to the forward.
     */
    public static void setActionDefinition(
        ServletRequest request,
        ComponentDefinition definition) {

        request.setAttribute(ACTION_DEFINITION, definition);
    }

    /**
     * Remove Definition stored in jsp context.
     * Mainly used by Struts to pass a definition defined in an Action to the forward.
     */
    public static void removeActionDefinition(
        ServletRequest request,
        ComponentDefinition definition) {

        request.removeAttribute(ACTION_DEFINITION);
    }

    /**
     * Populate Definition Factory Config from web.xml properties.
     * @param factoryConfig Definition Factory Config to populate.
     * @param servletConfig Current servlet config containing web.xml properties.
     * @exception IllegalAccessException if the caller does not have
     *  access to the property accessor method
     * @exception java.lang.reflect.InvocationTargetException if the property accessor method
     *  throws an exception
     * @see org.apache.commons.beanutils.BeanUtils
     * @since tiles 20020708
     */
    public static void populateDefinitionsFactoryConfig(
        DefinitionsFactoryConfig factoryConfig,
        ServletConfig servletConfig)
        throws IllegalAccessException, InvocationTargetException {

        Map properties = new DefinitionsUtil.ServletPropertiesMap(servletConfig);
        factoryConfig.populate(properties);
    }

    /**
     * Create FactoryConfig and initialize it from web.xml.
     *
     * @param servletConfig ServletConfig for the module with which
     *  this plug in is associated
     * @exception DefinitionsFactoryException if this <code>PlugIn</code> cannot
     *  be successfully initialized
     */
    protected static DefinitionsFactoryConfig readFactoryConfig(ServletConfig servletConfig)
        throws DefinitionsFactoryException {

        // Create tiles definitions config object
        DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();

        // Get init parameters from web.xml files
        try {
            DefinitionsUtil.populateDefinitionsFactoryConfig(
                factoryConfig,
                servletConfig);

        } catch (Exception ex) {
            ex.printStackTrace();
            throw new DefinitionsFactoryException(
                "Can't populate DefinitionsFactoryConfig class from 'web.xml'.",
                ex);
        }

        return factoryConfig;
    }

    /**
     * Inner class.
     * Wrapper for ServletContext init parameters.
     * Object of this class is an hashmap containing parameters and values
     * defined in the servlet config file (web.xml).
     */
    static class ServletPropertiesMap extends HashMap {
        /**
         * Constructor.
         */
        ServletPropertiesMap(ServletConfig config) {
            // This implementation is very simple.
            // It is possible to avoid creation of a new structure, but this need
            // imply writing all Map interface.
            Enumeration e = config.getInitParameterNames();
            while (e.hasMoreElements()) {
                String key = (String) e.nextElement();
                put(key, config.getInitParameter(key));
            }
        }
    } // end inner class

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品视频www在线观看| 日韩精品久久理论片| 丁香激情综合五月| 国产午夜一区二区三区| 国产一区二区三区久久悠悠色av| 亚洲专区一二三| 欧美午夜不卡视频| 日本中文字幕一区二区有限公司| 欧美一级日韩一级| 国产美女精品人人做人人爽| 中文av字幕一区| 色中色一区二区| 香蕉久久一区二区不卡无毒影院| 欧美一区二区三区男人的天堂| 老司机精品视频线观看86| 亚洲精品一区在线观看| 成人黄色免费短视频| 亚洲国产欧美一区二区三区丁香婷| 欧美日韩国产bt| 国产精品亚洲一区二区三区妖精 | av男人天堂一区| 亚洲精品高清在线| 日韩亚洲欧美中文三级| 国产精品1024| 亚洲成a人片在线不卡一二三区| 日韩欧美你懂的| 99久久久久久| 裸体歌舞表演一区二区| 国产精品女同互慰在线看| 欧美日韩综合不卡| 国产精品一区二区你懂的| 亚洲主播在线播放| 久久精品无码一区二区三区| 一本大道综合伊人精品热热| 麻豆国产精品视频| 悠悠色在线精品| www激情久久| 一区在线观看免费| 欧美一区二区在线免费观看| 成人免费视频app| 美女一区二区三区在线观看| 亚洲欧美另类小说| 2020国产成人综合网| 日本高清不卡视频| 成人免费视频一区二区| 美女国产一区二区三区| 尤物视频一区二区| 国产精品萝li| 精品99一区二区三区| 欧美日韩大陆一区二区| av欧美精品.com| 国产91丝袜在线播放九色| 麻豆视频观看网址久久| 亚洲成av人片| 亚洲乱码国产乱码精品精98午夜| 久久久777精品电影网影网| 欧美一区二区三区免费| 欧美亚洲一区三区| 99国产精品国产精品毛片| 国产成人精品影院| 黑人精品欧美一区二区蜜桃| 视频一区二区三区在线| 亚洲国产精品久久不卡毛片| 亚洲色图视频网| 中文字幕亚洲综合久久菠萝蜜| 久久久综合视频| 欧美成人精品福利| 欧美一区二区日韩| 91精品久久久久久久99蜜桃| 日本电影亚洲天堂一区| av在线一区二区| av电影在线观看一区| 成人午夜私人影院| 粉嫩av一区二区三区| 国产精华液一区二区三区| 国产精品自拍三区| 国产成人免费视频| 成人免费黄色在线| 99久久伊人网影院| av一区二区久久| av中文一区二区三区| aaa欧美日韩| 色婷婷久久99综合精品jk白丝| 韩国理伦片一区二区三区在线播放| 久久精品国产**网站演员| 美女www一区二区| 狠狠网亚洲精品| 成人小视频免费观看| 99免费精品视频| 欧美亚洲动漫精品| 欧美精品黑人性xxxx| 日韩精品中午字幕| 国产网红主播福利一区二区| 国产片一区二区三区| 日韩久久一区二区| 午夜久久福利影院| 久久se精品一区精品二区| 国产一区二区精品久久| aaa亚洲精品一二三区| 欧美亚洲动漫制服丝袜| 欧美一级片在线看| 欧美激情在线看| 亚洲综合久久久久| 精品一区二区三区不卡| 粉嫩一区二区三区在线看| 色老头久久综合| 欧美成人女星排行榜| 国产精品视频一二| 五月天中文字幕一区二区| 国产呦萝稀缺另类资源| 91视频免费看| 欧美成人性福生活免费看| 中文字幕日韩av资源站| 日韩高清一区在线| 岛国精品在线播放| 欧美日韩国产首页| 久久精品日韩一区二区三区| 亚洲欧美日韩国产综合| 久久se精品一区二区| 北岛玲一区二区三区四区| 7777精品久久久大香线蕉 | 91久久一区二区| 日韩精品一区二区三区蜜臀| 最新热久久免费视频| 美女网站色91| 色狠狠桃花综合| 国产亚洲自拍一区| 亚洲国产欧美另类丝袜| 国产精品资源在线| 欧美美女视频在线观看| 国产精品入口麻豆九色| 另类成人小视频在线| 日本国产一区二区| 国产女主播视频一区二区| 日韩av电影免费观看高清完整版 | 男人的天堂亚洲一区| 99亚偷拍自图区亚洲| 精品福利一区二区三区| 午夜精品一区在线观看| av一本久道久久综合久久鬼色| 欧美成人三级在线| 午夜精品一区二区三区电影天堂 | 亚洲欧美偷拍卡通变态| 久久99最新地址| 欧美日韩国产一级片| 亚洲欧美日韩久久| 成人中文字幕电影| 久久女同精品一区二区| 日韩和的一区二区| 欧美天堂亚洲电影院在线播放| 极品美女销魂一区二区三区 | 亚洲国产精品久久人人爱蜜臀| 成人免费va视频| 精品卡一卡二卡三卡四在线| 日日嗨av一区二区三区四区| 欧美色倩网站大全免费| 自拍偷自拍亚洲精品播放| 福利一区二区在线观看| 久久色.com| 国产精品自拍av| 久久精品亚洲一区二区三区浴池| 理论片日本一区| 精品成人一区二区| 久久99久久精品| 精品成人a区在线观看| 捆绑紧缚一区二区三区视频| 日韩一区二区免费在线电影| 日韩av一区二区三区| 日韩欧美国产一区二区三区| 日韩一区精品字幕| 日韩一区二区三区视频| 久久99精品久久久久久久久久久久| 日韩一区二区三区免费看| 老司机精品视频一区二区三区| 欧美大白屁股肥臀xxxxxx| 精品一区二区在线视频| 精品国产91乱码一区二区三区| 精品亚洲欧美一区| 久久久www成人免费毛片麻豆 | 51午夜精品国产| 另类小说色综合网站| 久久久精品国产免大香伊| 日韩中文字幕91| 精品一区二区在线观看| 久久亚洲精华国产精华液| 国产精品综合在线视频| 国产精品私人影院| 日本韩国欧美国产| 青青草97国产精品免费观看无弹窗版 | 99re在线视频这里只有精品| 国产精品成人午夜| 欧美三级日韩三级| 蜜臀av一区二区在线观看 | 欧美高清视频在线高清观看mv色露露十八 | 99re成人精品视频| 亚洲一区在线观看视频| 日韩精品在线看片z| 福利电影一区二区三区| 亚洲韩国精品一区| 精品成人一区二区三区|