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

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

?? action.java

?? ActionServlet源碼 struts的一個步驟都有 知道本來有視頻的太大了 就沒有上傳了
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Id: Action.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.action;

import org.apache.struts.Globals;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.ModuleUtils;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.TokenProcessor;

import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import java.util.Locale;

/**
 * <p>An <strong>Action</strong> is an adapter between the contents of an
 * incoming HTTP request and the corresponding business logic that should be
 * executed to process this request. The controller (RequestProcessor) will
 * select an appropriate Action for each request, create an instance (if
 * necessary), and call the <code>execute</code> method.</p>
 *
 * <p>Actions must be programmed in a thread-safe manner, because the
 * controller will share the same instance for multiple simultaneous requests.
 * This means you should design with the following items in mind: </p>
 *
 * <ul>
 *
 * <li>Instance and static variables MUST NOT be used to store information
 * related to the state of a particular request. They MAY be used to share
 * global resources across requests for the same action.</li>
 *
 * <li>Access to other resources (JavaBeans, session variables, etc.) MUST be
 * synchronized if those resources require protection. (Generally, however,
 * resource classes should be designed to provide their own protection where
 * necessary.</li>
 *
 * </ul>
 *
 * <p>When an <code>Action</code> instance is first created, the controller
 * will call <code>setServlet</code> with a non-null argument to identify the
 * servlet instance to which this Action is attached. When the servlet is to
 * be shut down (or restarted), the <code>setServlet</code> method will be
 * called with a <code>null</code> argument, which can be used to clean up any
 * allocated resources in use by this Action.</p>
 *
 * @version $Rev: 471754 $ $Date: 2005-08-26 21:58:39 -0400 (Fri, 26 Aug 2005)
 *          $
 */
public class Action {
    /**
     * <p>An instance of <code>TokenProcessor</code> to use for token
     * functionality.</p>
     */
    private static TokenProcessor token = TokenProcessor.getInstance();

    // NOTE: We can make the tken  variable protected and remove Action's
    // token methods or leave it private and allow the token methods to
    // delegate their calls.
    // ----------------------------------------------------- Instance Variables

    /**
     * <p>The servlet to which we are attached.</p>
     */
    protected transient ActionServlet servlet = null;

    // ------------------------------------------------------------- Properties

    /**
     * <p>Return the servlet instance to which we are attached.</p>
     *
     * @return The servlet instance to which we are attached.
     */
    public ActionServlet getServlet() {
        return (this.servlet);
    }

    /**
     * <p>Set the servlet instance to which we are attached (if
     * <code>servlet</code> is non-null), or release any allocated resources
     * (if <code>servlet</code> is null).</p>
     *
     * @param servlet The new controller servlet, if any
     */
    public void setServlet(ActionServlet servlet) {
        this.servlet = servlet;

        // :FIXME: Is this suppose to release resources?
    }

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

    /**
     * <p>Process the specified non-HTTP request, and create the corresponding
     * non-HTTP response (or forward to another web component that will create
     * it), with provision for handling exceptions thrown by the business
     * logic. Return an {@link ActionForward} instance describing where and
     * how control should be forwarded, or <code>null</code> if the response
     * has already been completed.</p>
     *
     * <p>The default implementation attempts to forward to the HTTP version
     * of this method.</p>
     *
     * @param mapping  The ActionMapping used to select this instance
     * @param form     The optional ActionForm bean for this request (if any)
     * @param request  The non-HTTP request we are processing
     * @param response The non-HTTP response we are creating
     * @return The forward to which control should be transferred, or
     *         <code>null</code> if the response has been completed.
     * @throws Exception if the application business logic throws an
     *                   exception.
     * @since Struts 1.1
     */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
        ServletRequest request, ServletResponse response)
        throws Exception {
        try {
            return execute(mapping, form, (HttpServletRequest) request,
                (HttpServletResponse) response);
        } catch (ClassCastException e) {
            return null;
        }
    }

    /**
     * <p>Process the specified HTTP request, and create the corresponding
     * HTTP response (or forward to another web component that will create
     * it), with provision for handling exceptions thrown by the business
     * logic. Return an {@link ActionForward} instance describing where and
     * how control should be forwarded, or <code>null</code> if the response
     * has already been completed.</p>
     *
     * @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
     * @return The forward to which control should be transferred, or
     *         <code>null</code> if the response has been completed.
     * @throws Exception if the application business logic throws an
     *                   exception
     * @since Struts 1.1
     */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
        return null;
    }

    // ---------------------------------------------------- Protected Methods

    /**
     * Adds the specified messages keys into the appropriate request attribute
     * for use by the &lt;html:messages&gt; tag (if messages="true" is set),
     * if any messages are required. Initialize the attribute if it has not
     * already been. Otherwise, ensure that the request attribute is not set.
     *
     * @param request  The servlet request we are processing
     * @param messages Messages object
     * @since Struts 1.2.1
     */
    protected void addMessages(HttpServletRequest request,
        ActionMessages messages) {
        if (messages == null) {
            //  bad programmer! *slap*
            return;
        }

        // get any existing messages from the request, or make a new one
        ActionMessages requestMessages =
            (ActionMessages) request.getAttribute(Globals.MESSAGE_KEY);

        if (requestMessages == null) {
            requestMessages = new ActionMessages();
        }

        // add incoming messages
        requestMessages.add(messages);

        // if still empty, just wipe it out from the request
        if (requestMessages.isEmpty()) {
            request.removeAttribute(Globals.MESSAGE_KEY);

            return;
        }

        // Save the messages
        request.setAttribute(Globals.MESSAGE_KEY, requestMessages);
    }

    /**
     * Adds the specified errors keys into the appropriate request attribute
     * for use by the &lt;html:errors&gt; tag, if any messages are required.
     * Initialize the attribute if it has not already been. Otherwise, ensure
     * that the request attribute is not set.
     *
     * @param request The servlet request we are processing
     * @param errors  Errors object
     * @since Struts 1.2.1
     */
    protected void addErrors(HttpServletRequest request, ActionMessages errors) {
        if (errors == null) {
            //  bad programmer! *slap*
            return;
        }

        // get any existing errors from the request, or make a new one
        ActionMessages requestErrors =
            (ActionMessages) request.getAttribute(Globals.ERROR_KEY);

        if (requestErrors == null) {
            requestErrors = new ActionMessages();
        }

        // add incoming errors
        requestErrors.add(errors);

        // if still empty, just wipe it out from the request
        if (requestErrors.isEmpty()) {
            request.removeAttribute(Globals.ERROR_KEY);

            return;
        }

        // Save the errors
        request.setAttribute(Globals.ERROR_KEY, requestErrors);
    }

    /**
     * <p>Generate a new transaction token, to be used for enforcing a single
     * request for a particular transaction.</p>
     *
     * @param request The request we are processing
     * @return The new transaction token.
     */
    protected String generateToken(HttpServletRequest request) {
        return token.generateToken(request);
    }

    /**
     * Retrieves any existing errors placed in the request by previous
     * actions. This method could be called instead of creating a <code>new
     * ActionMessages()</code> at the beginning of an <code>Action</code>.
     * This will prevent saveErrors() from wiping out any existing Errors
     *
     * @param request The servlet request we are processing
     * @return the Errors that already exist in the request, or a new
     *         ActionMessages object if empty.
     * @since Struts 1.2.1
     */
    protected ActionMessages getErrors(HttpServletRequest request) {
        ActionMessages errors =
            (ActionMessages) request.getAttribute(Globals.ERROR_KEY);

        if (errors == null) {
            errors = new ActionMessages();
        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本大道久久a久久综合| a级高清视频欧美日韩| 在线欧美日韩国产| 一区二区视频在线看| 在线观看一区二区视频| 亚洲成av人片| 日韩欧美国产综合在线一区二区三区| 日韩国产精品久久久| 日韩三级伦理片妻子的秘密按摩| 久久国产精品99久久人人澡| 亚洲精品一区在线观看| 春色校园综合激情亚洲| 亚洲码国产岛国毛片在线| 在线精品观看国产| 久久精品国产免费看久久精品| 久久综合久久久久88| 成人黄色小视频| 亚洲福利电影网| 精品91自产拍在线观看一区| 成人综合激情网| 亚洲图片欧美视频| 精品欧美黑人一区二区三区| av一区二区三区在线| 亚洲妇女屁股眼交7| 国产亚洲一区二区三区| aaa国产一区| 爽好久久久欧美精品| 久久久国产午夜精品| 在线观看国产日韩| 国内不卡的二区三区中文字幕| 综合久久久久综合| 精品免费99久久| 色综合久久综合网97色综合| 久久91精品久久久久久秒播| 中文字幕在线观看一区二区| 欧美一区中文字幕| 成人污污视频在线观看| 蜜臀av性久久久久蜜臀aⅴ | 国产乱子伦一区二区三区国色天香| 亚洲国产成人午夜在线一区| 欧美日韩一区二区三区四区五区 | 国产成人久久精品77777最新版本| 亚洲一级二级三级| 久久综合色婷婷| 欧美久久久久免费| www.成人网.com| 国内欧美视频一区二区| 亚洲午夜免费视频| 欧美国产日韩一二三区| 日韩欧美综合一区| 欧美在线你懂得| 99久久综合色| 国产精品18久久久久久久网站| 五月激情丁香一区二区三区| 亚洲天堂免费看| 国产欧美视频一区二区| 精品欧美一区二区三区精品久久| 日本高清不卡在线观看| 99这里只有精品| 国产不卡视频一区| 久久国产精品无码网站| 五月婷婷欧美视频| 亚洲在线成人精品| ...av二区三区久久精品| 精品国产凹凸成av人导航| 91精品国产黑色紧身裤美女| 欧美在线高清视频| 色老汉一区二区三区| 91蜜桃免费观看视频| 91在线免费看| 91视视频在线直接观看在线看网页在线看| 国产盗摄视频一区二区三区| 久久99国产精品尤物| 九九九久久久精品| 九色|91porny| 国产露脸91国语对白| 国产一区二区三区综合| 六月丁香综合在线视频| 久久精品国产999大香线蕉| 日本亚洲最大的色成网站www| 五月天亚洲婷婷| 日韩电影在线免费看| 琪琪一区二区三区| 九一九一国产精品| 国产精品99久久久久久宅男| 顶级嫩模精品视频在线看| 成人亚洲一区二区一| 99久久精品免费| 色偷偷成人一区二区三区91| 在线视频综合导航| 欧美精品成人一区二区三区四区| 欧美色网站导航| 日韩视频123| 久久精品无码一区二区三区 | 亚洲美女区一区| 一区二区高清视频在线观看| 亚洲一区二区av电影| 视频一区二区国产| 精品伊人久久久久7777人| 国产一区二区三区免费| 丁香婷婷综合激情五月色| 91麻豆精品秘密| 7777精品伊人久久久大香线蕉 | 国产日韩欧美电影| 亚洲欧洲精品成人久久奇米网| 亚洲欧美二区三区| 五月综合激情日本mⅴ| 国产永久精品大片wwwapp | 国产精品一区二区你懂的| 国产成人欧美日韩在线电影| 色婷婷av一区二区三区gif| 制服丝袜在线91| 国产色91在线| 亚洲不卡av一区二区三区| 国内欧美视频一区二区| 91黄视频在线| 精品粉嫩超白一线天av| 亚洲欧美激情一区二区| 久久精品国产免费看久久精品| 99国产精品国产精品毛片| 欧美日韩不卡视频| 日本一区二区视频在线观看| 亚洲成a天堂v人片| 国产电影精品久久禁18| 欧美精选一区二区| 国产精品嫩草99a| 日韩制服丝袜先锋影音| 97se亚洲国产综合在线| 日韩免费高清av| 一区二区三区日本| 国产精品羞羞答答xxdd| 91麻豆精品国产自产在线观看一区| 国产亚洲欧洲997久久综合| 亚洲www啪成人一区二区麻豆| 成人国产在线观看| 欧美一区二区三区男人的天堂 | 三级在线观看一区二区| 97久久人人超碰| 久久综合久久综合久久| 天天射综合影视| 97超碰欧美中文字幕| 中文字幕av在线一区二区三区| 免费看精品久久片| 欧美亚一区二区| 亚洲精品v日韩精品| 高清国产一区二区三区| 日韩免费在线观看| 日韩国产欧美在线播放| 欧美三级日韩三级| 亚洲精品视频免费看| 国产精品中文字幕欧美| 欧美v国产在线一区二区三区| 亚洲电影第三页| 91福利在线免费观看| 一色屋精品亚洲香蕉网站| 国产成人av一区| 精品国产sm最大网站免费看| 美脚の诱脚舐め脚责91| 555www色欧美视频| 亚洲国产wwwccc36天堂| 欧美性大战xxxxx久久久| 一区二区三区在线视频免费观看| 不卡av免费在线观看| 国产精品精品国产色婷婷| 国产成a人亚洲精品| 欧美高清在线精品一区| 顶级嫩模精品视频在线看| 中文字幕乱码日本亚洲一区二区| 国产精品自拍毛片| 国产情人综合久久777777| 国产大陆a不卡| 国产丝袜欧美中文另类| 成人丝袜高跟foot| 亚洲男人的天堂av| 91传媒视频在线播放| 亚洲妇女屁股眼交7| 欧美一区二区福利视频| 激情综合色播激情啊| 国产日韩在线不卡| 91捆绑美女网站| 丝袜美腿亚洲综合| 日韩精品中文字幕一区二区三区| 韩国av一区二区三区四区 | 一区二区在线看| 在线观看欧美黄色| 日日噜噜夜夜狠狠视频欧美人 | 欧美大片顶级少妇| 国产精品一级片在线观看| 国产片一区二区| 91黄视频在线| 美国十次综合导航| 欧美激情综合在线| 在线观看欧美黄色| 激情深爱一区二区| 国产精品电影一区二区| 欧美日韩视频第一区| 国产在线播放一区三区四| 亚洲欧美另类久久久精品2019| 91精品国产色综合久久ai换脸| 国产一区二区三区电影在线观看|