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

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

?? action.java

?? structs源碼
?? 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一区二区三区免费野_久草精品视频
精品一区二区三区香蕉蜜桃| 大白屁股一区二区视频| 麻豆精品一区二区综合av| 国产成人免费视频一区| 日本精品一级二级| 精品国精品国产| 中文字幕亚洲一区二区av在线| 一区二区三区国产豹纹内裤在线 | 一区二区三区四区中文字幕| 欧美激情一区二区三区四区| 亚洲成人一区二区| 91天堂素人约啪| 中文一区在线播放| 国内精品自线一区二区三区视频| av电影在线观看完整版一区二区| 91精品国产一区二区人妖| 国产精品网曝门| 久久成人综合网| 欧洲精品一区二区三区在线观看| 久久久午夜精品| 日韩高清欧美激情| 97久久久精品综合88久久| 精品国产一区二区三区不卡| 亚洲国产欧美日韩另类综合| 成人免费观看av| 国产亚洲欧美日韩日本| 首页综合国产亚洲丝袜| 色婷婷精品久久二区二区蜜臀av | 91蝌蚪porny九色| 久久综合色8888| 美女www一区二区| 丁香激情综合国产| 久久综合国产精品| 麻豆精品一区二区| 666欧美在线视频| 国产精品嫩草99a| 首页亚洲欧美制服丝腿| 91国偷自产一区二区三区成为亚洲经典| 久久婷婷久久一区二区三区| 亚洲精品成人悠悠色影视| 精品中文av资源站在线观看| 日韩女优av电影在线观看| 亚洲午夜成aⅴ人片| 色一情一乱一乱一91av| 亚洲视频综合在线| 日本精品一区二区三区高清| 亚洲精品乱码久久久久| 99国产精品久久| 亚洲黄色性网站| 欧美在线观看一二区| 亚洲成av人片在线| 欧美老人xxxx18| 日韩精品久久理论片| 欧美一区二区视频免费观看| 免费人成黄页网站在线一区二区 | 国产超碰在线一区| 中文子幕无线码一区tr| 91网址在线看| 亚洲成人在线网站| 欧美电影免费观看高清完整版在线观看 | 日韩亚洲欧美中文三级| 久久97超碰色| 日本一区二区三级电影在线观看| 国产999精品久久久久久绿帽| 中文字幕日韩av资源站| 91国偷自产一区二区三区观看| 亚洲激情第一区| 欧美日韩国产成人在线免费| 蓝色福利精品导航| 中文字幕一区二区三区在线不卡| 国产精品自拍在线| 久久久综合精品| 成人丝袜视频网| 亚洲激情六月丁香| 精品国产精品一区二区夜夜嗨| 视频一区在线播放| 国产日韩欧美一区二区三区乱码| 国产一区二区福利| 亚洲成人久久影院| 精品人伦一区二区色婷婷| 国产suv精品一区二区883| 亚洲激情中文1区| 精品欧美一区二区在线观看| 成人综合在线观看| 午夜私人影院久久久久| 精品理论电影在线| 91色porny| 精品一区二区三区的国产在线播放| 中文文精品字幕一区二区| 在线观看免费一区| 国产不卡免费视频| 日韩精品成人一区二区在线| 国产精品嫩草99a| 日韩精品最新网址| 91国产丝袜在线播放| 欧美96一区二区免费视频| 日本一区二区不卡视频| 在线免费一区三区| 国产精品一品二品| 亚洲欧美成aⅴ人在线观看| 日韩精品在线一区| 99久久精品久久久久久清纯| 国产揄拍国内精品对白| 丝袜亚洲精品中文字幕一区| 国产精品三级电影| www国产成人免费观看视频 深夜成人网| 99九九99九九九视频精品| 国内精品免费**视频| 亚洲成在人线在线播放| 亚洲三级免费观看| 中文字幕av资源一区| 精品欧美一区二区在线观看| 欧美日韩黄色一区二区| 欧美艳星brazzers| 97久久超碰国产精品| 国产成人精品免费在线| 国产综合久久久久影院| 免费av成人在线| 亚洲蜜臀av乱码久久精品蜜桃| 欧美电影免费观看高清完整版在| 欧美精品高清视频| 欧美性受xxxx黑人xyx性爽| 99久久国产综合精品女不卡| 国产91对白在线观看九色| 国产在线观看免费一区| 精品在线一区二区| 韩国成人在线视频| 久久99久国产精品黄毛片色诱| 天天色天天爱天天射综合| 亚洲成人自拍一区| 日日夜夜免费精品视频| 偷拍一区二区三区四区| 亚洲国产日韩a在线播放| 亚洲国产综合在线| 亚洲国产毛片aaaaa无费看| 亚洲一区二区在线播放相泽| 亚洲国产美女搞黄色| 五月综合激情日本mⅴ| 日日摸夜夜添夜夜添亚洲女人| 肉色丝袜一区二区| 日韩电影一区二区三区| 黄色日韩网站视频| 国产精品77777| 成人午夜激情片| 色噜噜狠狠成人网p站| 欧美中文字幕不卡| 欧美男生操女生| 久久欧美中文字幕| 国产精品视频一二三| 亚洲视频免费观看| 亚洲一区二区三区四区在线观看| 三级不卡在线观看| 国产乱人伦偷精品视频免下载| 国产白丝精品91爽爽久久| 色综合久久88色综合天天6| 欧美日韩午夜影院| 精品国产乱码久久久久久图片| 日韩午夜激情免费电影| 国产日韩欧美综合一区| 久久久久久久久岛国免费| 亚洲欧美日韩小说| 男女视频一区二区| 成人av免费在线观看| 欧美高清一级片在线| 欧美国产日韩一二三区| 亚洲国产精品一区二区久久恐怖片| 久久国产尿小便嘘嘘| 一本色道综合亚洲| 日韩网站在线看片你懂的| 欧美成人精品1314www| 2020国产成人综合网| 亚洲图片欧美综合| 天堂va蜜桃一区二区三区漫画版| 狠狠色狠狠色综合| 欧洲亚洲精品在线| 久久久久久久免费视频了| 亚洲国产毛片aaaaa无费看 | 日韩精品资源二区在线| 国产精品丝袜在线| 三级欧美在线一区| 精品一区二区在线免费观看| 99久久免费国产| 欧美精品视频www在线观看| 久久久91精品国产一区二区精品| 亚洲精品高清在线观看| 精品一区二区在线观看| 色婷婷国产精品| 久久精品亚洲国产奇米99| 美女国产一区二区| 欧美专区日韩专区| 国产精品国产精品国产专区不蜜| 麻豆91免费观看| 欧美午夜精品久久久| 亚洲精品一二三| 岛国一区二区在线观看| 久久久久国产精品麻豆| 久久99精品一区二区三区三区| 欧美蜜桃一区二区三区| 亚洲麻豆国产自偷在线| av激情亚洲男人天堂|