|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectorg.apache.struts2.dispatcher.StrutsResultSupport
org.apache.struts2.dispatcher.ServletRedirectResult
public class ServletRedirectResult
Calls the sendRedirect
method to the location specified. The response is told to redirect the
browser to the specified location (a new request from the client). The
consequence of doing this means that the action (action instance, action
errors, field errors, etc) that was just executed is lost and no longer
available. This is because actions are built on a single-thread model. The
only way to pass data is through the session or with web parameters
(url?name=value) which can be OGNL expressions.
This result follows the same rules from StrutsResultSupport
.
<!-- The redirect URL generated will be: /foo.jsp#FRAGMENT --> <result name="success" type="redirect"> <param name="location">foo.jsp</param> <param name="parse">false</param> <param name="anchor">FRAGMENT</param> </result>
字段摘要 |
---|
从类 org.apache.struts2.dispatcher.StrutsResultSupport 继承的字段 |
---|
DEFAULT_PARAM |
从接口 org.apache.struts2.StrutsStatics 继承的字段 |
---|
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT |
构造方法摘要 | |
---|---|
ServletRedirectResult()
|
|
ServletRedirectResult(String location)
|
|
ServletRedirectResult(String location,
String anchor)
|
方法摘要 | |
---|---|
ServletRedirectResult |
addParameter(String key,
Object value)
Adds a request parameter to be added to the redirect url |
void |
execute(com.opensymphony.xwork2.ActionInvocation invocation)
Implementation of the execute method from the Result interface. |
void |
handle(com.opensymphony.xwork2.util.reflection.ReflectionException ex)
|
void |
setActionMapper(ActionMapper mapper)
|
void |
setAnchor(String anchor)
Set the optional anchor value. |
void |
setPrependServletContext(boolean prependServletContext)
Sets whether or not to prepend the servlet context path to the redirected URL. |
void |
setStatusCode(int code)
|
void |
setSuppressEmptyParameters(boolean suppressEmptyParameters)
Sets the suppressEmptyParameters option |
void |
setUrlHelper(UrlHelper urlHelper)
|
从类 org.apache.struts2.dispatcher.StrutsResultSupport 继承的方法 |
---|
getLastFinalLocation, getLocation, setEncode, setLocation, setParse |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public ServletRedirectResult()
public ServletRedirectResult(String location)
public ServletRedirectResult(String location, String anchor)
方法详细信息 |
---|
public void setActionMapper(ActionMapper mapper)
public void setUrlHelper(UrlHelper urlHelper)
public void setStatusCode(int code)
public void setAnchor(String anchor)
anchor
- public void setPrependServletContext(boolean prependServletContext)
prependServletContext
- true to prepend the location with the servlet context path, false otherwise.public void execute(com.opensymphony.xwork2.ActionInvocation invocation) throws Exception
StrutsResultSupport
复制的描述StrutsResultSupport.doExecute(String, ActionInvocation)
after optionally evaluating the
location as an OGNL evaluation.
com.opensymphony.xwork2.Result
中的 execute
StrutsResultSupport
中的 execute
invocation
- the execution state of the action.
Exception
- if an error occurs while executing the result.public void setSuppressEmptyParameters(boolean suppressEmptyParameters)
suppressEmptyParameters
- The new value for this optionpublic ServletRedirectResult addParameter(String key, Object value)
key
- The parameter namevalue
- The parameter valuepublic void handle(com.opensymphony.xwork2.util.reflection.ReflectionException ex)
com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler
中的 handle
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |