org.enhydra.barracuda.core.util.http
Class URLRewriter

java.lang.Object
  |
  +--org.enhydra.barracuda.core.util.http.URLRewriter

public class URLRewriter
extends java.lang.Object

This just contains some Servlet utility routines


Field Summary
static boolean REWRITE_URLS
          This option is used to control whether or not URL rewriting occurs.
 
Constructor Summary
URLRewriter()
           
 
Method Summary
static java.lang.String encodeRedirectURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String url)
          Encode a redirect URL if the REWRITE_URLS option is set.
static java.lang.String encodeRedirectURL(ViewContext vc, java.lang.String url)
          Encode a redirect URL if the REWRITE_URLS option is set.
static java.lang.String encodeURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String url)
          Encode a URL if the REWRITE_URLS option is set.
static java.lang.String encodeURL(ViewContext vc, java.lang.String url)
          Encode a URL if the REWRITE_URLS option is set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REWRITE_URLS

public static boolean REWRITE_URLS
This option is used to control whether or not URL rewriting occurs. It exists to handle bugs in Enhydra 3.x in which invoking the URL rewriting methods causes a bogus value to be returned. If you are using Enhydra 3.x, you will want to set this value to false (you can do this without coding changes via the your assembler xml file). To see whether or not your appserver correctly implements URL rewriting, look at http://localhost/Barracuda/RedirectEx1

Constructor Detail

URLRewriter

public URLRewriter()
Method Detail

encodeURL

public static java.lang.String encodeURL(ViewContext vc,
                                         java.lang.String url)
Encode a URL if the REWRITE_URLS option is set. Using this option makes it easy to reconfigure Barracuda if your server has problems with URL rewriting (ie. Enhydra 3.x)

Parameters:
vc - the ViewContext
url - the target url
Returns:
an encoded url (unless REWRITE_URLS = false, in which case it will just return the original url value)

encodeURL

public static java.lang.String encodeURL(javax.servlet.http.HttpServletRequest req,
                                         javax.servlet.http.HttpServletResponse resp,
                                         java.lang.String url)
Encode a URL if the REWRITE_URLS option is set. Using this option makes it easy to reconfigure Barracuda if your server has problems with URL rewriting (ie. Enhydra 3.x)

Parameters:
req - the servlet request
resp - the servlet response
url - the target url
Returns:
an encoded url (unless REWRITE_URLS = false, in which case it will just return the original url value)

encodeRedirectURL

public static java.lang.String encodeRedirectURL(ViewContext vc,
                                                 java.lang.String url)
Encode a redirect URL if the REWRITE_URLS option is set. Using this option makes it easy to reconfigure Barracuda if your server has problems with URL rewriting (ie. Enhydra 3.x)

Parameters:
vc - the ViewContext
url - the target url
Returns:
an encoded url (unless REWRITE_URLS = false, in which case it will just return the original url value)

encodeRedirectURL

public static java.lang.String encodeRedirectURL(javax.servlet.http.HttpServletRequest req,
                                                 javax.servlet.http.HttpServletResponse resp,
                                                 java.lang.String url)
Encode a redirect URL if the REWRITE_URLS option is set. Using this option makes it easy to reconfigure Barracuda if your server has problems with URL rewriting (ie. Enhydra 3.x)

Parameters:
req - the servlet request
resp - the servlet response
url - the target url
Returns:
an encoded url (unless REWRITE_URLS = false, in which case it will just return the original url value)


Copyright © 2001 Enhydra.org