org.apache.beehive.netui.pageflow.internal
Class DefaultURLRewriter

Object
  extended by URLRewriter
      extended by DefaultURLRewriter

public class DefaultURLRewriter
extends URLRewriter


Nested Class Summary
 
Nested classes/interfaces inherited from class URLRewriter
URLRewriter.URLType
 
Constructor Summary
DefaultURLRewriter()
           
 
Method Summary
 boolean equals(Object object)
          Determines if the passed-in Object is equivalent to this DefaultURLRewriter.
 String getNamePrefix(ServletContext servletContext, ServletRequest request, String name)
          Get the prefix to use when rewriting a query parameter name.
 int hashCode()
          Returns a hash code value for the object.
 void rewriteURL(ServletContext servletContext, ServletRequest request, ServletResponse response, MutableURI url, URLRewriter.URLType type, boolean needsToBeSecure)
          Rewrite the given URL.
 
Methods inherited from class URLRewriter
allowOtherRewriters, allowParamsOnFormAction, setAllowOtherRewriters
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultURLRewriter

public DefaultURLRewriter()
Method Detail

getNamePrefix

public String getNamePrefix(ServletContext servletContext,
                            ServletRequest request,
                            String name)
Description copied from class: URLRewriter
Get the prefix to use when rewriting a query parameter name. Loops through the list of registered URLRewriters to build up a the prefix.

Specified by:
getNamePrefix in class URLRewriter
Parameters:
servletContext - the current ServletContext.
request - the current ServletRequest.
name - the name of the query parameter.
Returns:
a prefix to use to rewrite a query parameter name.

rewriteURL

public void rewriteURL(ServletContext servletContext,
                       ServletRequest request,
                       ServletResponse response,
                       MutableURI url,
                       URLRewriter.URLType type,
                       boolean needsToBeSecure)
Description copied from class: URLRewriter
Rewrite the given URL.

Specified by:
rewriteURL in class URLRewriter
Parameters:
servletContext - the current ServletContext.
request - the current ServletRequest.
response - the current ServletResponse.
url - the MutableURI to be rewritten.
type - the type of URL to be rewritten. This is one of the following values:
  • action: a standard (non-resource) URL
  • resource: a resource (e.g., image) URL
needsToBeSecure - a flag indicating whether the URL should be secure (SSL required) or not

equals

public boolean equals(Object object)
Determines if the passed-in Object is equivalent to this DefaultURLRewriter. Since there is no member data for this class they will all be equal.

Overrides:
equals in class Object
Parameters:
object - the Object to test for equality.
Returns:
true if object is another instance of DefaultURLRewriter.

hashCode

public int hashCode()
Returns a hash code value for the object. Implemented in conjunction with equals() override. Since there is no member data for this class we always return the same value.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.