亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品久久久久久亚洲综合网 | 欧美日韩精品专区| 91精品国产综合久久久久| 国产三级精品视频| 亚洲a一区二区| 成人av在线播放网址| 7777精品伊人久久久大香线蕉 | av不卡免费电影| 日韩一区二区三区高清免费看看| 国产亚洲午夜高清国产拍精品| 亚洲激情av在线| 成人黄色片在线观看| 久久久综合视频| 美国毛片一区二区| 欧美私模裸体表演在线观看| 欧美激情一区二区三区在线| 久久精品噜噜噜成人88aⅴ| 欧美伊人精品成人久久综合97| 中文字幕第一区第二区| 国产一区二区剧情av在线| 欧美精品1区2区| 午夜欧美在线一二页| 99v久久综合狠狠综合久久| 国产婷婷色一区二区三区在线| 日韩国产精品久久久| 91精品办公室少妇高潮对白| 亚洲国产精品成人综合色在线婷婷 | 久久精品一区蜜桃臀影院| 美女性感视频久久| 日韩精品一区二区三区中文不卡 | 欧美日韩一级片网站| 中文字幕一区二区三区四区| 国产91精品在线观看| 久久亚洲一区二区三区明星换脸| 日本一不卡视频| 欧美系列亚洲系列| 亚洲综合区在线| 欧美少妇xxx| 亚洲一级二级三级在线免费观看| 色噜噜狠狠成人中文综合| 亚洲女人****多毛耸耸8| 99久久久精品| 一区二区视频在线看| 精品视频资源站| 男人的天堂亚洲一区| 日韩免费观看高清完整版在线观看| 婷婷中文字幕综合| 91精品国产综合久久久久久久久久 | 日本午夜一本久久久综合| 欧美精品三级在线观看| 视频一区欧美日韩| 日韩欧美国产小视频| 麻豆久久久久久久| 久久久91精品国产一区二区三区| 成人性生交大片免费看视频在线| 欧美国产日韩亚洲一区| 99国产欧美久久久精品| 亚洲欧洲韩国日本视频 | 国产精品69毛片高清亚洲| 久久综合色鬼综合色| 成人午夜激情片| 亚洲激情图片qvod| 欧美一级精品大片| 国产91精品入口| 亚洲电影第三页| 久久久99精品久久| 欧美三级视频在线| 国产成人亚洲精品青草天美| 最新热久久免费视频| 91精品综合久久久久久| 成人午夜激情片| 视频精品一区二区| 国产网红主播福利一区二区| 91国偷自产一区二区三区观看| 亚洲超碰精品一区二区| 久久影院视频免费| 欧美午夜一区二区三区 | 中文在线一区二区| 欧美三区在线观看| 懂色一区二区三区免费观看| 午夜久久久久久久久久一区二区| 国产亚洲欧洲997久久综合| 欧美性猛交一区二区三区精品| 九九九精品视频| 自拍偷拍国产亚洲| 精品999在线播放| 欧美综合天天夜夜久久| 国产乱人伦偷精品视频不卡| 亚洲一本大道在线| 国产精品理伦片| 日韩精品一区二区三区蜜臀| 欧美综合视频在线观看| 成人国产精品免费观看动漫| 日韩高清不卡一区| 亚洲精品日产精品乱码不卡| 久久久久88色偷偷免费| 欧美日韩国产区一| 99久精品国产| 国产电影精品久久禁18| 秋霞国产午夜精品免费视频| 亚洲狠狠丁香婷婷综合久久久| 国产欧美日韩精品一区| 久久婷婷国产综合国色天香 | 天天影视涩香欲综合网| 亚洲狼人国产精品| 一区二区中文字幕在线| 中文字幕高清一区| 国产精品久久久久久久裸模| 久久久久99精品一区| 久久综合色综合88| 久久久久一区二区三区四区| 亚洲精品一区二区三区影院| 日韩免费一区二区| 精品国产乱码久久久久久浪潮 | 欧美三级中文字| 欧美视频中文字幕| 欧美三级韩国三级日本三斤| 色噜噜狠狠色综合欧洲selulu| 在线观看一区二区视频| 在线视频综合导航| 欧美少妇xxx| 国产精品免费视频一区| 久久色视频免费观看| 国产欧美久久久精品影院| 国产日韩欧美麻豆| 中文字幕在线观看不卡| 亚洲另类春色国产| 日韩综合在线视频| 裸体一区二区三区| 国产福利电影一区二区三区| 成人爱爱电影网址| 色偷偷88欧美精品久久久| 日本电影欧美片| 91麻豆精品国产| 国产午夜精品理论片a级大结局| 国产精品久久久久三级| 亚洲精品国产成人久久av盗摄| 亚洲一区二区精品久久av| 久久精品国产在热久久| 国产成人亚洲综合色影视| 99视频精品免费视频| 欧美日韩国产美| 久久精品在线免费观看| 亚洲欧美另类综合偷拍| 日韩精品亚洲一区| 国产一区二区电影| 99精品欧美一区| 91精品国产综合久久精品图片| 精品国产第一区二区三区观看体验| 国产午夜一区二区三区| 亚洲永久免费av| 九九九精品视频| 色综合久久久久网| 精品美女一区二区| 亚洲精品老司机| 狠狠色狠狠色综合| 色www精品视频在线观看| 欧美xxxxxxxxx| 一区二区三区四区不卡在线 | 韩国理伦片一区二区三区在线播放| 成人开心网精品视频| 欧美久久久久久久久久| 国产日本欧洲亚洲| 亚洲成人精品影院| 成人激情免费视频| 欧美一级片免费看| 国产成人精品网址| 91精品久久久久久蜜臀| 亚洲日本青草视频在线怡红院| 日韩电影免费一区| 91理论电影在线观看| 欧美精品一区二区三区一线天视频| 亚洲精品视频在线观看网站| 国产精品一区二区你懂的| 欧美日韩国产免费一区二区| 成人欧美一区二区三区小说| 激情丁香综合五月| 欧美精品在欧美一区二区少妇| 综合欧美一区二区三区| 国产福利91精品一区二区三区| 欧美一区二区三区视频在线观看| 亚洲色图色小说| 成人动漫一区二区三区| 精品福利一二区| 蜜臀91精品一区二区三区| 欧美亚洲动漫制服丝袜| 中文字幕一区二区三区精华液 | 美洲天堂一区二卡三卡四卡视频| 在线这里只有精品| 亚洲日本中文字幕区| 懂色一区二区三区免费观看| 久久精品人人做| 国产美女精品在线| 精品剧情在线观看| 久久99国产乱子伦精品免费| 日韩欧美黄色影院| 久久精品国产亚洲高清剧情介绍| 欧美精品99久久久**| 午夜伦理一区二区| 911国产精品|