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

📄 redirect.java

📁 webwork source
💻 JAVA
字号:
/* * WebWork, Web Application Framework * * Distributable under Apache license. * See terms of license at opensource.org */package webwork.action.standard;import webwork.action.ActionSupport;import webwork.action.ServletResponseAware;import webwork.action.CommandDriven;import webwork.action.ResultException;import javax.servlet.http.HttpServletResponse;/** *	Redirect to a given URL. Do not map any view to this action. * *	@see <related> *	@author Rickard 謆erg (rickard@middleware-company.com) *	@version $Revision: 1.11 $ */public class Redirect   extends ActionSupport   implements ServletResponseAware{   // Attributes ----------------------------------------------------   String url;   HttpServletResponse response;   // Static --------------------------------------------------------   // Implements ServletResponseAware -------------------------------   public void setServletResponse(HttpServletResponse aResponse)   {      response = aResponse;   }   // Public --------------------------------------------------------   /**    * URL to redirect to    */   public void setUrl(String aUrl)   {      url = aUrl;   }   public String getUrl()   {      return url;   }    protected void validate() throws ResultException {        //don't do anything - this keeps it from failing to redirect if the action it is chained from has errors    }   // Action implementation -----------------------------------------   /**    * Redirect to URL    */   protected String doExecute()      throws Exception   {      if (url == null)        return ERROR;      url = response.encodeUrl(url);      response.sendRedirect(url);      return NONE;   }}

⌨️ 快捷键说明

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