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

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

?? action.java

?? Apache struts-1.3.10 a stable version
?? 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在线播放中文字幕| 日韩一级大片在线| 国产精品一线二线三线精华| 久久亚洲私人国产精品va媚药| 国产福利不卡视频| 国产精品国模大尺度视频| 91丝袜美腿高跟国产极品老师| 亚洲综合激情网| 欧美一区二区三区视频| 久久97超碰色| 中文字幕欧美一| 欧美午夜精品免费| 美女www一区二区| 国产亚洲va综合人人澡精品| 99精品欧美一区| 性久久久久久久久| 久久久亚洲综合| 91看片淫黄大片一级| 亚洲6080在线| 久久久青草青青国产亚洲免观| 成人激情午夜影院| 丝袜美腿成人在线| 欧美精品一区二区三区四区 | 国产精品乱人伦| 欧美曰成人黄网| 狠狠色丁香久久婷婷综| 自拍av一区二区三区| 欧美一级理论性理论a| 国产成人久久精品77777最新版本| 一区二区免费看| 久久美女高清视频| 欧美日韩aaaaaa| 国产成人综合网| 亚洲成人你懂的| 中文字幕精品一区二区三区精品 | 欧美亚洲国产bt| 国产精品一区在线观看乱码| 一区二区三区影院| 亚洲va天堂va国产va久| 国产亚洲一二三区| 91精品国产色综合久久| a美女胸又www黄视频久久| 日韩电影免费在线| 亚洲美女视频在线观看| 久久综合五月天婷婷伊人| 在线观看国产91| 成人小视频免费观看| 蜜桃精品视频在线| 亚洲欧美激情小说另类| 久久久久亚洲蜜桃| 欧美一级专区免费大片| 99re这里都是精品| 国产成人三级在线观看| 九九视频精品免费| 青青国产91久久久久久| 亚洲成av人片一区二区三区| 亚洲天堂a在线| 国产午夜亚洲精品午夜鲁丝片 | 午夜精品在线视频一区| 国产精品久久久久久久午夜片| 久久蜜桃一区二区| 精品国产乱码久久久久久1区2区| 欧美久久久久中文字幕| 在线免费观看日韩欧美| 91亚洲精品乱码久久久久久蜜桃| 国产很黄免费观看久久| 精品一区二区三区的国产在线播放| 亚洲成人免费av| 亚洲一区中文在线| 亚洲精品福利视频网站| 亚洲精品国产精华液| 日韩久久一区二区| 亚洲精品国久久99热| 亚洲男人天堂av网| 亚洲影视在线播放| 一区二区三区四区在线| 一区二区三区日韩欧美| 夜夜嗨av一区二区三区四季av | 亚洲乱码国产乱码精品精98午夜 | 在线播放视频一区| 欧美美女直播网站| 欧美人与性动xxxx| 欧美一级午夜免费电影| 欧美tickling网站挠脚心| 日韩视频免费观看高清完整版 | 香蕉成人伊视频在线观看| 亚洲一区在线电影| 亚洲国产精品一区二区www在线| 亚洲国产精品嫩草影院| 午夜影视日本亚洲欧洲精品| 亚洲一区二区在线视频| 亚洲成av人综合在线观看| 日韩经典中文字幕一区| 久久国产福利国产秒拍| 国产伦精品一区二区三区在线观看 | 国产成人午夜高潮毛片| 国产精品亚洲人在线观看| 高清不卡一二三区| 一本一本大道香蕉久在线精品| 在线观看日韩高清av| 69久久99精品久久久久婷婷 | 麻豆久久一区二区| 国产成人无遮挡在线视频| 色综合久久久久综合99| 欧美精品vⅰdeose4hd| 欧美xxxxxxxxx| 中文字幕高清一区| 亚洲国产欧美日韩另类综合| 另类的小说在线视频另类成人小视频在线 | 成人美女在线观看| 色婷婷av一区二区三区之一色屋| 91精品国产综合久久婷婷香蕉| 亚洲精品在线免费观看视频| 亚洲图片你懂的| 美女精品自拍一二三四| 99久久伊人久久99| 91精品国产黑色紧身裤美女| 国产日韩精品一区二区三区在线| 一区二区在线观看av| 精品一区二区免费| 色噜噜久久综合| 欧美tk—视频vk| 亚洲午夜精品一区二区三区他趣| 精品一区二区免费看| 在线观看www91| 久久免费国产精品| 天堂一区二区在线| 成人免费毛片app| 欧美一区二区视频在线观看 | 日韩欧美成人午夜| 一区二区三区欧美亚洲| 国产一区免费电影| 欧美精品v国产精品v日韩精品| 国产精品福利影院| 狠狠v欧美v日韩v亚洲ⅴ| 欧美日韩中文一区| 中文字幕一区二区5566日韩| 另类专区欧美蜜桃臀第一页| 色欧美片视频在线观看| 日本一区二区免费在线观看视频| 日本aⅴ亚洲精品中文乱码| 99视频有精品| 久久日一线二线三线suv| 三级亚洲高清视频| 91福利精品视频| 国产精品毛片久久久久久| 黄页视频在线91| 日韩亚洲国产中文字幕欧美| 亚洲国产一区二区视频| 成人免费视频caoporn| 精品欧美一区二区久久| 日韩电影在线看| 欧美日韩视频在线第一区| 亚洲色图制服诱惑 | 亚洲一区二区免费视频| 色综合中文字幕国产| 久久九九全国免费| 激情文学综合网| 精品少妇一区二区三区免费观看| 五月天久久比比资源色| 欧美日韩高清一区| 亚洲午夜视频在线| 在线观看国产91| 亚洲香蕉伊在人在线观| 欧美日韩国产美女| 亚洲国产精品一区二区www | www久久精品| 精品一区二区在线看| 欧美成人伊人久久综合网| 伦理电影国产精品| 久久综合色天天久久综合图片| 极品少妇一区二区三区精品视频| 日韩欧美国产综合在线一区二区三区| 美女性感视频久久| 精品国产91乱码一区二区三区| 狠狠网亚洲精品| 久久精品亚洲国产奇米99| 国产二区国产一区在线观看| 国产三级精品视频| 97久久超碰国产精品电影| 自拍偷拍亚洲综合| 欧美伊人久久久久久午夜久久久久| 一区二区三区成人| 欧美日韩不卡在线| 黄色精品一二区| 中文字幕中文字幕一区二区| 色综合久久66| 午夜精品一区二区三区三上悠亚 | 91精品国产欧美一区二区成人| 麻豆久久一区二区| 国产三级一区二区| 一本到不卡免费一区二区| 亚洲曰韩产成在线|