⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forwardaction.java

📁 >项目名称:电脑电子商务平台 >1.运行环境JDK1.6+Oracle10g+Tomcat5.5 >2.开发工具: MyEclipse Enterprise Workbench
💻 JAVA
字号:
/*
 * $Id: SuccessAction.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 omega.struts.action.admin.sort;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 * <p>
 * An Action that forwards control via a "success" ActionFoward.
 * </p>
 * 
 * <p>
 * A recommended strategy is that view pages should link only to Actions and
 * never directly to other views. In situations where the view does not require
 * any preparation you can use a SuccessAction, specifying the view as an
 * ActionForward named "success" in your action mapping.
 * </p>
 * 
 * <p>
 * e.g. If you configure an ActionMapping in struts-config.xml like this:
 * </p>
 * 
 * <pre>
 *     &lt;action path=&quot;/prepareView&quot;
 *             type=&quot;examples.SuccessAction&quot;&gt;
 *         &lt;forward name=&quot;success&quot; path=&quot;/jsp/View.jsp&quot;/&gt;
 *     &amp;lt/action&gt;
 * </pre>
 * 
 * <p>
 * You could create a link to the view (via the Action) as follows:
 * </p>
 * 
 * <pre>
 *      &lt;html:link action=&quot;/prepareView&quot;&gt;Display 'view' page&lt;/html:link&gt;
 * </pre>
 * 
 * <p>
 * If you later change your application such that the view page requires some
 * initialization you can change a single ActionMapping definition in
 * struts-config.xml rather than lots of link definitions in many JSPs.
 * </p>
 * 
 * @version $Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $
 */
public class ForwardAction extends Action {

	// ------------------------------------------------------------ Constructors

	/**
	 * Constructor for SuccessAction.
	 */
	public ForwardAction() {
		super();
	}

	// ---------------------------------------------------------- Action Methods

	/**
	 * Returns the <code>ActionForward</code> named "success" if one is
	 * configured or <code>null</code>if it cannot be found.
	 * 
	 * Searches first for a local forward, then a global forward.
	 * 
	 * @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
	 * 
	 * @exception Exception
	 *                if mapping.findForward throws an Exception
	 * 
	 * @return the "success" ActionForward, or null if it cannot be found
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		return mapping.findForward("success");

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -