com.ora.jsp.tags.generic
Class RedirectTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.ora.jsp.tags.generic.RedirectTag
All Implemented Interfaces:
ParamParent, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class RedirectTag
extends javax.servlet.jsp.tagext.TagSupport
implements ParamParent

This class is a custom action for sending a redirect request, with possible parameter values URL encoded and the complete URL encoded for URL rewriting (session tracking).

Version:
1.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Inner Class Summary
(package private)  class RedirectTag.Param
          This is a helper class that holds the name and value of a parameter.
 
Field Summary
private  java.lang.String page
           
private  java.util.Vector params
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext, parent, values
 
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()
          Appends possible URL encoded parameters to the main URL, encodes the result for URL rewriting.
 int doStartTag()
          Override the default implementation so that possible param actions in the body are processed.
 void release()
          Releases all instance variables.
 void setPage(java.lang.String page)
          Sets the page attribute.
 void setParam(java.lang.String name, java.lang.String value)
          Adds a parameter name and value.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

page

private java.lang.String page

params

private java.util.Vector params
Constructor Detail

RedirectTag

public RedirectTag()
Method Detail

setPage

public void setPage(java.lang.String page)
Sets the page attribute.
Parameters:
page - the page URL to redirect to

setParam

public void setParam(java.lang.String name,
                     java.lang.String value)
Adds a parameter name and value. This method is called by param tags in the action body.
Specified by:
setParam in interface ParamParent
Parameters:
name - the parameter name
value - the URL encoded parameter value

doStartTag

public int doStartTag()
Override the default implementation so that possible param actions in the body are processed.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Appends possible URL encoded parameters to the main URL, encodes the result for URL rewriting. Clears the out buffer and sets the redirect response headers. Returns SKIP_PAGE to abort the processing of the rest of the page.
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport

release

public void release()
Releases all instance variables.
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport