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

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

?? actiondispatcher.java

?? struts的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Id: ActionDispatcher.java 383720 2006-03-07 00:07:59Z niallp $
 *
 * Copyright 2005-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.actions;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.MessageResources;
import org.apache.struts.Globals;

/**
 * <p>Action <i>helper</i> class that dispatches to a public method in an Action.</p>
 * <p/>
 * <p>This class is provided as an alternative mechanism to using DispatchAction
 * and its various flavours and means <i>Dispatch</i> behaviour can be
 * easily implemented into any <code>Action</code> without having to
 * inherit from a particular super <code>Action</code>.</p>
 * <p/>
 * <p>To implement <i>dispatch</i> behaviour</i> in an <code>Action</code> class,
 * create your custom Action as follows, along with the methods you
 * require (and optionally "cancelled" and "unspecified" methods):</p>
 * <p/>
 * <pre>
 *   public class MyCustomAction extends Action {
 * 
 *       protected ActionDispatcher dispatcher
 *                = new ActionDispatcher(this, ActionDispatcher.MAPPING_FLAVOR);
 * 
 *       public ActionForward execute(ActionMapping mapping,
 *                                    ActionForm form,
 *                                    HttpServletRequest request,
 *                                    HttpServletResponse response)
 *                           throws Exception {
 *           return dispatcher.execute(mapping, form, request, response);
 *       }
 *   }
 * </pre>
 * <p/>
 * <p>It provides three flavours of determing the name of the method:</p>
 * <p/>
 * <ul>
 * <li><strong>{@link #DEFAULT_FLAVOR}</strong> - uses the parameter specified in
 * the struts-config.xml to get the method name from the Request
 * (equivalent to <code>DispatchAction</code> <b>except</b> uses "method"
 * as a default if the <code>parameter</code> is not specified
 * in the struts-config.xml).</li>
 * <p/>
 * <li><strong>{@link #DISPATCH_FLAVOR}</strong> - uses the parameter specified in
 * the struts-config.xml to get the method name from the Request
 * (equivalent to <code>DispatchAction</code>).</li>
 * <p/>
 * <li><strong>{@link #MAPPING_FLAVOR}</strong> - uses the parameter specified in
 * the struts-config.xml as the method name
 * (equivalent to <code>MappingDispatchAction</code>).</li>
 * <p/>
 * </ul>
 *
 * @since Struts 1.2.7
 * @version $Revision: 383720 $ $Date: 2006-03-07 00:07:59 +0000 (Tue, 07 Mar 2006) $
 */
public class ActionDispatcher {


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

    /**
     * Indicates "default" dispatch flavor
     */
    public static final int DEFAULT_FLAVOR = 0;

    /**
     * Indicates "mapping" dispatch flavor
     */
    public static final int MAPPING_FLAVOR = 1;

    /**
     * Indicates flavor compatible with DispatchAction
     */
    public static final int DISPATCH_FLAVOR = 2;


    /**
     * The associated Action to dispatch to.
     */
    protected Action actionInstance;

    /**
     * Indicates dispatch <i>flavor</i>
     */
    protected int flavor;

    /**
     * The Class instance of this <code>DispatchAction</code> class.
     */
    protected Class clazz;

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


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


    /**
     * The set of Method objects we have introspected for this class,
     * keyed by method name.  This collection is populated as different
     * methods are called, so that introspection needs to occur only
     * once per method name.
     */
    protected HashMap methods = new HashMap();

    /**
     * The set of argument type classes for the reflected method call.  These
     * are the same for all calls, so calculate them only once.
     */
    protected Class[] types = {
        ActionMapping.class,
        ActionForm.class,
        HttpServletRequest.class,
        HttpServletResponse.class};

    // ----------------------------------------------------- Constructors

    public ActionDispatcher(Action actionInstance) {
        this(actionInstance, DEFAULT_FLAVOR);
    }


    public ActionDispatcher(Action actionInstance, int flavor) {

        this.actionInstance = actionInstance;
        this.flavor = flavor;

        clazz = actionInstance.getClass();

    }


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


    /**
     * Process the specified HTTP request, and create the corresponding HTTP
     * response (or forward to another web component that will create it).
     * Return an <code>ActionForward</code> instance describing where and how
     * control should be forwarded, or <code>null</code> if the response has
     * already been completed.
     *
     * @param mapping  The ActionMapping used to select this instance
     * @param form     The optional ActionForm bean for this request (if any)
     * @param request  The HTTP request we are processing
     * @param response The HTTP response we are creating
     * @throws Exception if an exception occurs
     */
    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {

        // Process "cancelled"
        if (isCancelled(request)) {
            ActionForward af = cancelled(mapping, form, request, response);
            if (af != null) {
                return af;
            }
        }
        // Identify the request parameter containing the method name
        String parameter = getParameter(mapping, form, request, response);

        // Get the method's name. This could be overridden in subclasses.
        String name = getMethodName(mapping, form, request, response, parameter);


        // Prevent recursive calls
        if ("execute".equals(name) || "perform".equals(name)) {
            String message =
                    messages.getMessage("dispatch.recursive", mapping.getPath());

            log.error(message);
            throw new ServletException(message);
        }


        // Invoke the named method, and return the result
        return dispatchMethod(mapping, form, request, response, name);

    }


    /**
     * <p>Dispatches to the target class' <code>unspecified</code> method,  
     * if present, otherwise throws a ServletException. Classes utilizing 
     * <code>ActionDispatcher</code> should provide an <code>unspecified</code> 
     * method if they wish to provide behavior different than 
     * throwing a ServletException..</p>
     */
    protected ActionForward unspecified(ActionMapping mapping,
                                        ActionForm form,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
            throws Exception {


        // Identify if there is an "unspecified" method to be dispatched to

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产欧美在线播放| 欧美成人猛片aaaaaaa| 91精品国产美女浴室洗澡无遮挡| 欧美一级片在线看| 中文欧美字幕免费| 一区二区在线看| 六月丁香综合在线视频| 懂色av一区二区三区免费看| 在线亚洲免费视频| 日韩欧美国产麻豆| 国产精品丝袜黑色高跟| 亚洲国产中文字幕| 国产福利一区二区三区视频| 国产自产高清不卡| 一本色道久久加勒比精品 | 亚洲第一精品在线| 韩日av一区二区| 在线精品视频小说1| 日韩免费电影一区| 亚洲免费观看高清完整版在线| 青椒成人免费视频| youjizz国产精品| 欧美一区二区在线免费观看| 国产精品乱码一区二区三区软件 | 欧美午夜寂寞影院| 久久久久99精品国产片| 五月天欧美精品| 成人高清视频在线观看| 欧美精品 国产精品| 欧美高清在线视频| 日韩va欧美va亚洲va久久| 成人午夜伦理影院| 精品国产一区二区亚洲人成毛片| 亚洲精品乱码久久久久| 国产一区二区在线观看视频| 欧美日韩一区高清| 亚洲视频你懂的| 国产精品资源网| 欧美精品久久一区| 亚洲欧美一区二区三区久本道91| 国内国产精品久久| 欧美精品在线一区二区三区| 1024成人网色www| 福利一区二区在线| 精品国精品国产| 性欧美疯狂xxxxbbbb| 97精品国产露脸对白| 精品福利在线导航| 日本在线不卡一区| 欧美亚洲另类激情小说| 中文字幕在线播放不卡一区| 国产一区激情在线| 日韩欧美二区三区| 日韩精品亚洲一区| 欧美性受xxxx| 一区二区三区不卡视频在线观看| 盗摄精品av一区二区三区| 欧美成人福利视频| 青青草精品视频| 欧美日韩国产高清一区二区| 一区二区在线看| 一本色道久久综合亚洲aⅴ蜜桃 | 99精品久久只有精品| 久久精品网站免费观看| 国内精品视频666| 欧美v国产在线一区二区三区| 人人超碰91尤物精品国产| 欧美男女性生活在线直播观看| 亚洲最大成人网4388xx| 一本色道a无线码一区v| 日韩美女视频一区| 91在线码无精品| 亚洲精品国产视频| 欧美性猛片aaaaaaa做受| 亚洲一区二区偷拍精品| 在线观看不卡视频| 亚洲高清免费在线| 欧美日韩黄色一区二区| 午夜精品一区二区三区免费视频| 欧美中文字幕一区| 亚洲无线码一区二区三区| 欧美色视频在线观看| 午夜国产精品一区| 欧美精品久久一区二区三区| 久久精品国产**网站演员| 欧美大尺度电影在线| 国产在线观看一区二区| 久久精子c满五个校花| 波多野结衣亚洲一区| 自拍偷在线精品自拍偷无码专区| 91视频国产观看| 亚洲福利一区二区三区| 欧美一区二区黄| 国产风韵犹存在线视精品| 欧美国产在线观看| 色综合天天综合色综合av| 一二三区精品视频| 欧美一区二区三区电影| 国产老肥熟一区二区三区| 亚洲欧洲美洲综合色网| 欧美精品丝袜久久久中文字幕| 欧美aⅴ一区二区三区视频| 久久精品日产第一区二区三区高清版 | 色综合久久久久综合| 亚洲一级在线观看| 日韩欧美亚洲另类制服综合在线| 国产裸体歌舞团一区二区| 国产精品久久久久久久久果冻传媒| 在线亚洲免费视频| 日本欧美加勒比视频| 久久亚洲一级片| 91网站黄www| 青青草原综合久久大伊人精品| 久久精品欧美一区二区三区不卡 | 亚洲黄色av一区| 欧美一区二区性放荡片| 成人免费av资源| 五月天激情小说综合| 久久久久国产精品人| 91福利精品第一导航| 久久99精品久久久久婷婷| 欧美韩日一区二区三区| 欧美精品粉嫩高潮一区二区| 国产精一区二区三区| 一区二区三区欧美日| 2020国产成人综合网| 日本福利一区二区| 精品在线免费视频| 一区二区三区在线视频播放| 欧美精品一区二区蜜臀亚洲| 欧美在线观看视频一区二区三区 | 国产精品三级av| 欧美日韩成人在线| 大胆亚洲人体视频| 日韩电影一二三区| 亚洲欧洲性图库| 日韩视频免费观看高清在线视频| 91免费版在线| 国产在线麻豆精品观看| 不卡的av电影| 一区二区在线电影| 精品国产免费视频| 欧美日韩一区中文字幕| jlzzjlzz亚洲日本少妇| 久久机这里只有精品| 亚洲激情图片一区| 国产日韩在线不卡| 欧美一区二区三区喷汁尤物| 色呦呦一区二区三区| 国产盗摄精品一区二区三区在线| 日韩经典中文字幕一区| 亚洲天堂福利av| 国产欧美日韩不卡| 欧美大片拔萝卜| 欧美电影在哪看比较好| 色8久久人人97超碰香蕉987| 粉嫩蜜臀av国产精品网站| 麻豆视频一区二区| 亚洲不卡在线观看| 亚洲女厕所小便bbb| 国产精品嫩草影院com| 精品欧美乱码久久久久久 | 日韩国产欧美视频| 一区二区在线观看免费| 亚洲视频香蕉人妖| 国产精品进线69影院| 国产精品欧美一区喷水| 国产亚洲精品福利| 亚洲精品在线网站| 欧美一区二区三区啪啪| 欧美肥妇bbw| 欧美色图在线观看| 在线视频综合导航| 91女厕偷拍女厕偷拍高清| 懂色av一区二区夜夜嗨| 国产99精品国产| 国产精品白丝av| 国产美女精品在线| 九色|91porny| 韩日av一区二区| 国产专区欧美精品| 国产一区二区免费看| 久久精品99国产精品| 老色鬼精品视频在线观看播放| 天天色天天操综合| 视频一区视频二区在线观看| 亚洲va欧美va天堂v国产综合| 亚洲一区二区成人在线观看| 亚洲成人激情av| 蜜臀av一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅| 久久超碰97人人做人人爱| 久久电影网电视剧免费观看| 久久99精品久久久久久国产越南 | 日韩一区二区视频在线观看| 日韩欧美一级二级三级| 精品日产卡一卡二卡麻豆| 精品不卡在线视频| 久久久久亚洲蜜桃| 国产精品久线观看视频|