亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美无乱码久久久免费午夜一区| 国产精品久久网站| 欧美国产日韩a欧美在线观看| 亚洲精品欧美在线| 国产美女主播视频一区| 欧美日韩黄色影视| 国产精品欧美久久久久一区二区| 日韩电影在线观看网站| 91麻豆.com| 亚洲国产高清aⅴ视频| 蜜桃av一区二区三区电影| 欧美午夜在线一二页| 中文字幕综合网| 丁香亚洲综合激情啪啪综合| 欧美成人精品1314www| 午夜精品福利视频网站| 91免费看片在线观看| 国产亚洲欧美色| 精品一区二区三区影院在线午夜| 欧美剧情片在线观看| 亚洲一区二区四区蜜桃| 色视频一区二区| 亚洲人成在线观看一区二区| 北条麻妃国产九九精品视频| 国产精品灌醉下药二区| 国产白丝网站精品污在线入口| 精品粉嫩aⅴ一区二区三区四区| 蜜桃久久久久久久| 4438x亚洲最大成人网| 五月天中文字幕一区二区| 色综合一区二区| 一区二区三区日韩精品视频| 91看片淫黄大片一级在线观看| 国产精品久久久久精k8| 成人中文字幕电影| 中文字幕免费在线观看视频一区| 国产一区二区伦理| 亚洲国产精品精华液ab| 丰满白嫩尤物一区二区| 国产精品欧美一区喷水| 99久久国产综合精品色伊| 国产精品久久毛片av大全日韩| 99re6这里只有精品视频在线观看| 国产精品久久久久久久久久免费看| eeuss鲁片一区二区三区在线观看| 国产精品视频第一区| 91免费看`日韩一区二区| 亚洲精品视频免费看| 5858s免费视频成人| 久久99久久99| 国产精品久久久久永久免费观看 | 在线综合亚洲欧美在线视频| 蜜桃久久久久久久| 国产午夜精品一区二区| 99免费精品视频| 亚洲午夜视频在线| 337p日本欧洲亚洲大胆色噜噜| 丰满白嫩尤物一区二区| 亚洲综合免费观看高清完整版 | 成人性生交大片| 亚洲乱码中文字幕综合| 69堂成人精品免费视频| 国产一二三精品| 亚洲午夜羞羞片| 久久一区二区视频| 欧美在线|欧美| 国产一区二区女| 亚洲成人av资源| 国产欧美日韩综合| 欧美三级在线看| 岛国av在线一区| 亚洲精品国产一区二区精华液 | 欧美一区二区三区视频在线 | 国产亚洲欧美日韩日本| 国产成人午夜精品5599| 亚洲精品视频免费观看| 久久综合给合久久狠狠狠97色69| 99久久精品国产麻豆演员表| 亚洲国产另类av| 久久久精品免费免费| 欧美性色黄大片| 成人av网站在线观看免费| 五月综合激情网| 最新久久zyz资源站| 精品国产乱子伦一区| 在线视频一区二区三区| 丁香六月久久综合狠狠色| 日本一区中文字幕| 综合久久久久综合| 久久日一线二线三线suv| 欧美日韩你懂得| 91在线观看下载| 福利一区在线观看| 国产自产高清不卡| 美女任你摸久久| 日韩专区中文字幕一区二区| 亚洲精品免费在线| 最近日韩中文字幕| 中文字幕在线视频一区| 久久久99久久| 久久午夜国产精品| 精品国产三级a在线观看| 欧美高清视频一二三区| 在线观看不卡一区| 色噜噜久久综合| 99久久综合狠狠综合久久| 国产精品888| 国产河南妇女毛片精品久久久| 久久国产麻豆精品| 美女在线观看视频一区二区| 日韩黄色在线观看| 人妖欧美一区二区| 乱中年女人伦av一区二区| 久久狠狠亚洲综合| 久国产精品韩国三级视频| 久久福利视频一区二区| 久久精品国产一区二区三 | 亚洲综合一区二区精品导航| 亚洲人妖av一区二区| 亚洲日本va在线观看| 尤物在线观看一区| 亚洲成人免费视| 午夜久久福利影院| 精品在线免费视频| 顶级嫩模精品视频在线看| 99久久综合国产精品| 欧洲精品中文字幕| 7777精品伊人久久久大香线蕉的| 欧美高清精品3d| www精品美女久久久tv| 国产无人区一区二区三区| 国产精品国产自产拍高清av王其 | 日韩影院在线观看| 久久成人麻豆午夜电影| 盗摄精品av一区二区三区| 色综合久久久久网| 欧美日韩色一区| 欧美精品一区二区三区在线播放| 国产精品久久久久久久久图文区 | 亚洲图片欧美综合| 日本欧美一区二区三区乱码| 国内精品免费在线观看| 9人人澡人人爽人人精品| 3d动漫精品啪啪1区2区免费| 国产欧美视频在线观看| 亚洲精品中文在线观看| 免费观看30秒视频久久| 成人精品免费看| 欧美丰满美乳xxx高潮www| 欧美激情在线免费观看| 亚洲高清视频的网址| 国产一区二区精品久久| 色偷偷一区二区三区| 日韩精品一区二区三区四区视频 | 中文字幕不卡的av| 亚洲va韩国va欧美va| 国产一区91精品张津瑜| 精品视频资源站| 日本一区二区三级电影在线观看| 亚洲va国产天堂va久久en| 国产福利一区二区三区视频| 欧美日韩精品久久久| 国产精品久久夜| 国产在线精品免费| 91黄色在线观看| 欧美国产精品一区二区| 人人爽香蕉精品| 欧美午夜电影网| 中文字幕第一区综合| 蜜乳av一区二区| 8x8x8国产精品| 亚洲一区二区三区激情| 成人手机在线视频| 精品国产一区二区三区久久影院| 亚洲韩国精品一区| 93久久精品日日躁夜夜躁欧美| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲制服丝袜一区| 91最新地址在线播放| 国产亚洲精品7777| 国产做a爰片久久毛片| 717成人午夜免费福利电影| 一区二区在线观看视频| 99久久精品99国产精品| 国产三级精品视频| 美女在线一区二区| 日韩午夜在线观看视频| 亚洲高清免费在线| 欧美图片一区二区三区| 一区二区三区在线播放| 91麻豆高清视频| 18成人在线视频| 国产不卡免费视频| 久久影视一区二区| 国产福利91精品一区| 国产欧美综合在线观看第十页| 激情成人综合网| 国产亚洲一区二区在线观看| 国产经典欧美精品| 欧美激情自拍偷拍|