org.apache.struts.taglib.logic
Class RedirectTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.struts.taglib.logic.RedirectTag
All Implemented Interfaces:
Serializable, IterationTag, Tag
Direct Known Subclasses:
ELRedirectTag

public class RedirectTag
extends TagSupport

Generate a URL-encoded redirect to the specified URI.

Version:
$Rev: 471754 $ $Date: 2004-10-16 12:38:42 -0400 (Sat, 16 Oct 2004) $
See Also:
Serialized Form

Field Summary
protected  String action
          The module-relative action (beginning with a slash) which will be called by this link
protected  String anchor
          The anchor to be added to the end of the generated hyperlink.
protected  String forward
          The logical forward name from which to retrieve the redirect URI.
protected  String href
          The redirect URI.
protected static MessageResources messages
          The message resources for this package.
protected  String module
          The module prefix (beginning with a slash) which will be used to find the action for this link.
protected  String name
          The JSP bean name for query parameters.
protected  String page
          The module-relative page URL (beginning with a slash) to which this redirect will be rendered.
protected  String paramId
          The single-parameter request parameter name to generate.
protected  String paramName
          The single-parameter JSP bean name.
protected  String paramProperty
          The single-parameter JSP bean property.
protected  String paramScope
          The single-parameter JSP bean scope.
protected  String property
          The JSP bean property name for query parameters.
protected  String scope
          The scope of the bean specified by the name property, if any.
protected  boolean transaction
          Include our transaction control token?
protected  boolean useLocalEncoding
          Use character encoding from ServletResponse#getCharacterEncoding to get bytes of the url string for urlencoding?
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
RedirectTag()
           
 
Method Summary
 int doEndTag()
          Render the redirect and skip the remainder of this page.
protected  void doRedirect(String url)
          Redirect to the given url converting exceptions to JspException.
 int doStartTag()
          Defer generation until the end of this tag is encountered.
protected  String generateRedirectURL()
          Calculate the url to redirect to.
 String getAction()
           
 String getAnchor()
           
 String getForward()
           
 String getHref()
           
 String getModule()
           
 String getName()
           
 String getPage()
           
 String getParamId()
           
 String getParamName()
           
 String getParamProperty()
           
 String getParamScope()
           
 String getProperty()
           
 String getScope()
           
 boolean getTransaction()
           
 boolean isUseLocalEncoding()
           
 void release()
          Release any acquired resources.
 void setAction(String action)
           
 void setAnchor(String anchor)
           
 void setForward(String forward)
           
 void setHref(String href)
           
 void setModule(String module)
           
 void setName(String name)
           
 void setPage(String page)
           
 void setParamId(String paramId)
           
 void setParamName(String paramName)
           
 void setParamProperty(String paramProperty)
           
 void setParamScope(String paramScope)
           
 void setProperty(String property)
           
 void setScope(String scope)
           
 void setTransaction(boolean transaction)
           
 void setUseLocalEncoding(boolean b)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

protected static MessageResources messages
The message resources for this package.


anchor

protected String anchor
The anchor to be added to the end of the generated hyperlink.


forward

protected String forward
The logical forward name from which to retrieve the redirect URI.


href

protected String href
The redirect URI.


name

protected String name
The JSP bean name for query parameters.


page

protected String page
The module-relative page URL (beginning with a slash) to which this redirect will be rendered.


action

protected String action
The module-relative action (beginning with a slash) which will be called by this link


module

protected String module
The module prefix (beginning with a slash) which will be used to find the action for this link.


paramId

protected String paramId
The single-parameter request parameter name to generate.


paramName

protected String paramName
The single-parameter JSP bean name.


paramProperty

protected String paramProperty
The single-parameter JSP bean property.


paramScope

protected String paramScope
The single-parameter JSP bean scope.


property

protected String property
The JSP bean property name for query parameters.


scope

protected String scope
The scope of the bean specified by the name property, if any.


transaction

protected boolean transaction
Include our transaction control token?


useLocalEncoding

protected boolean useLocalEncoding
Use character encoding from ServletResponse#getCharacterEncoding to get bytes of the url string for urlencoding?

Constructor Detail

RedirectTag

public RedirectTag()
Method Detail

getAnchor

public String getAnchor()

setAnchor

public void setAnchor(String anchor)

getForward

public String getForward()

setForward

public void setForward(String forward)

getHref

public String getHref()

setHref

public void setHref(String href)

getName

public String getName()

setName

public void setName(String name)

getPage

public String getPage()

setPage

public void setPage(String page)

getAction

public String getAction()

setAction

public void setAction(String action)

getModule

public String getModule()

setModule

public void setModule(String module)

getParamId

public String getParamId()

setParamId

public void setParamId(String paramId)

getParamName

public String getParamName()

setParamName

public void setParamName(String paramName)

getParamProperty

public String getParamProperty()

setParamProperty

public void setParamProperty(String paramProperty)

getParamScope

public String getParamScope()

setParamScope

public void setParamScope(String paramScope)

getProperty

public String getProperty()

setProperty

public void setProperty(String property)

getScope

public String getScope()

setScope

public void setScope(String scope)

getTransaction

public boolean getTransaction()

setTransaction

public void setTransaction(boolean transaction)

isUseLocalEncoding

public boolean isUseLocalEncoding()

setUseLocalEncoding

public void setUseLocalEncoding(boolean b)

doStartTag

public int doStartTag()
               throws JspException
Defer generation until the end of this tag is encountered.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Throws:
JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws JspException
Render the redirect and skip the remainder of this page.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Throws:
JspException - if a JSP exception has occurred

generateRedirectURL

protected String generateRedirectURL()
                              throws JspException
Calculate the url to redirect to.

Throws:
JspException
Since:
Struts 1.2

doRedirect

protected void doRedirect(String url)
                   throws JspException
Redirect to the given url converting exceptions to JspException.

Parameters:
url - The path to redirect to.
Throws:
JspException
Since:
Struts 1.2

release

public void release()
Release any acquired resources.

Specified by:
release in interface Tag
Overrides:
release in class TagSupport


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.