亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成人午夜视频在线| www.亚洲激情.com| 亚洲自拍都市欧美小说| 中文字幕一区二区三区色视频| 久久久久一区二区三区四区| 久久这里只精品最新地址| 日韩亚洲国产中文字幕欧美| 欧美日韩国产三级| 欧美一区二区三区视频免费| 91精品国产色综合久久不卡电影| 欧美一区二区三区精品| 精品嫩草影院久久| 国产精品入口麻豆原神| 中文字幕亚洲一区二区va在线| 亚洲欧洲日韩av| 亚洲一区二区影院| 视频在线观看91| 国产老妇另类xxxxx| 成人黄色小视频在线观看| 91在线视频观看| 欧美日韩亚洲国产综合| 日韩欧美黄色影院| 国产精品久久夜| 无吗不卡中文字幕| 国产精品一区二区x88av| 91免费国产在线| 日韩视频在线一区二区| 中文字幕免费观看一区| 亚洲3atv精品一区二区三区| 久久国产免费看| 在线观看日韩国产| 久久精品这里都是精品| 亚洲成人动漫在线免费观看| 国产一区二区在线观看视频| 一本久道中文字幕精品亚洲嫩| 欧美日韩国产综合一区二区三区| 2022国产精品视频| 五月天亚洲婷婷| 成人aa视频在线观看| 91精品婷婷国产综合久久竹菊| 国产精品女同互慰在线看| 午夜影院久久久| 99精品欧美一区二区三区小说 | 国产精品原创巨作av| k8久久久一区二区三区| 日韩一级二级三级| 亚洲一区二区三区美女| 国产成人av资源| 日韩欧美高清一区| 亚欧色一区w666天堂| 成人综合婷婷国产精品久久| 精品国产露脸精彩对白| 日本亚洲欧美天堂免费| 色综合久久久久网| 亚洲欧美自拍偷拍色图| 国产综合久久久久影院| 日韩视频永久免费| 午夜不卡在线视频| 在线影院国内精品| 亚洲欧洲三级电影| www.av精品| 国产精品网曝门| 国产成人免费高清| 精品国产免费久久| 韩国精品主播一区二区在线观看 | 国产一区二区久久| 日韩欧美另类在线| 久久国产夜色精品鲁鲁99| 日韩午夜在线播放| 免费一区二区视频| 精品日韩99亚洲| 国产麻豆精品久久一二三| 欧美成人欧美edvon| 精品在线一区二区三区| 欧美大片日本大片免费观看| 美女精品一区二区| 日韩精品一区二区三区三区免费 | 麻豆久久一区二区| 日韩三级视频中文字幕| 久久国产精品一区二区| 欧美精品一区二区蜜臀亚洲| 国产呦精品一区二区三区网站| 日韩你懂的在线观看| 国产一区二区不卡| 国产肉丝袜一区二区| 波多野结衣一区二区三区| 国产精品国产自产拍在线| 91网上在线视频| 午夜国产精品影院在线观看| 精品国产91乱码一区二区三区 | 欧美日韩aaaaa| 久久成人18免费观看| 国产日韩影视精品| 91同城在线观看| 日韩精品亚洲专区| 精品奇米国产一区二区三区| 成人激情电影免费在线观看| 一区二区欧美视频| 日韩免费在线观看| 99视频一区二区| 日韩福利视频导航| 国产精品电影一区二区三区| 欧美日本视频在线| 成人性生交大片免费看中文网站| 亚洲一区二区在线视频| 久久这里只有精品首页| 在线一区二区视频| 蜜臀a∨国产成人精品| 国产精品电影一区二区三区| 9191久久久久久久久久久| 国产精品一二三区| 亚洲大片在线观看| 欧美国产日产图区| 日韩视频一区在线观看| 91久久精品网| 国产成人av一区二区三区在线| 亚洲国产日韩a在线播放性色| 国产亚洲一区二区三区在线观看 | 国产精品一级二级三级| 亚洲综合无码一区二区| 久久久久97国产精华液好用吗| 欧美日韩国产一级片| av电影一区二区| 国产精品香蕉一区二区三区| 日日夜夜精品视频天天综合网| 中文一区二区完整视频在线观看| 欧美日韩国产片| 日本韩国欧美在线| 成人美女视频在线观看| 国内外成人在线| 蜜桃视频一区二区三区| 亚洲成人免费在线观看| 亚洲色图一区二区三区| 国产欧美一区在线| 久久这里都是精品| 26uuu国产日韩综合| 日韩欧美在线一区二区三区| 在线免费观看日韩欧美| av不卡在线播放| 成人性色生活片免费看爆迷你毛片| 日本欧美在线观看| 奇米影视在线99精品| 亚洲妇女屁股眼交7| 亚洲1区2区3区4区| 午夜视频一区二区| 在线精品视频一区二区三四| 一区二区三区成人| 亚洲女厕所小便bbb| 国产精品久久国产精麻豆99网站| 国产亚洲精品精华液| 精品国产不卡一区二区三区| 精品三级在线看| 欧美白人最猛性xxxxx69交| 正在播放亚洲一区| 欧美日韩免费不卡视频一区二区三区| 色香蕉久久蜜桃| 91浏览器入口在线观看| 色哟哟一区二区在线观看 | 色综合一区二区| 色欲综合视频天天天| 91久久一区二区| 91精品欧美一区二区三区综合在 | 欧美丝袜丝nylons| 欧美人与性动xxxx| 欧美电影免费观看高清完整版在| xf在线a精品一区二区视频网站| 久久色.com| 中文字幕制服丝袜成人av| 亚洲视频1区2区| 日本不卡高清视频| 国产成人免费视频精品含羞草妖精| 懂色av一区二区三区蜜臀| 色综合天天视频在线观看| 欧美日韩午夜在线| 亚洲精品一区二区三区99| 国产精品国产三级国产a | 日韩欧美一区在线| 国产欧美一区二区三区沐欲| 亚洲欧美日韩国产综合在线| 午夜视频在线观看一区二区三区| 极品美女销魂一区二区三区免费| 国产99久久久国产精品潘金网站| 色播五月激情综合网| 欧美精品一区在线观看| 亚洲伦理在线免费看| 久久成人免费网| 91精品1区2区| 国产三级精品在线| 丝袜美腿亚洲色图| eeuss鲁片一区二区三区| 日韩一区二区三区视频| 亚洲欧洲精品天堂一级| 美女视频一区在线观看| 色嗨嗨av一区二区三区| 久久婷婷综合激情| 五月激情六月综合| 91小视频免费观看| 欧美国产精品v| 久久成人免费网| 欧美精品色一区二区三区|