org.apache.beehive.netui.pageflow.util
Class URLRewriterService

Object
  extended by URLRewriterService

Deprecated. Use URLRewriterService instead.

public class URLRewriterService
extends Object

Methods for registering URL rewriters, and for rewriting URLs using registered rewriters.


Constructor Summary
URLRewriterService()
          Deprecated.  
 
Method Summary
static boolean allowParamsOnFormAction(ServletContext servletContext, ServletRequest request)
          Deprecated. Tell whether rewritten form actions should be allowed to have query parameters.
static String getActionMappingName(String action)
          Deprecated. Return the form action converted into an action mapping path.
static URLRewriter getDefaultRewriter()
          Deprecated. Get the default URLRewriter.
static boolean needsSecure(ServletRequest request, ServletContext context, String uri, boolean stripContextPath)
          Deprecated. Tell whether a given URI should be written to be secure.
static void registerURLRewriter(ServletRequest request, URLRewriter rewriter)
          Deprecated. Register a URLRewriter in the request.
static String rewriteName(ServletContext servletContext, ServletRequest request, String name)
          Deprecated. Rewrite the given parameter name, using the registered URLRewriter.
static String rewriteURL(ServletContext servletContext, ServletRequest request, ServletResponse response, String url, String type)
          Deprecated. Rewrite the given URL, using the registered URLRewriter.
static String rewriteURL(ServletContext servletContext, ServletRequest request, ServletResponse response, String url, String type, boolean doEncode)
          Deprecated. Rewrite the given URL, using the registered URLRewriter.
static URLRewriter unregisterURLRewriter(ServletRequest request)
          Deprecated. Unregister the URLRewriter from the request.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLRewriterService

public URLRewriterService()
Deprecated. 
Method Detail

getDefaultRewriter

public static final URLRewriter getDefaultRewriter()
Deprecated. 
Get the default URLRewriter.

Returns:
an instance of DefaultURLRewriter.

rewriteName

public static String rewriteName(ServletContext servletContext,
                                 ServletRequest request,
                                 String name)
Deprecated. 
Rewrite the given parameter name, using the registered URLRewriter.

Parameters:
servletContext - the current ServletContext.
request - the current HttpServletRequest.
name - the parameter name to rewrite.
Returns:
the rewritten parameter name.

rewriteURL

public static String rewriteURL(ServletContext servletContext,
                                ServletRequest request,
                                ServletResponse response,
                                String url,
                                String type)
Deprecated. 
Rewrite the given URL, using the registered URLRewriter.

Parameters:
servletContext - the current ServletContext.
request - the current HttpServletRequest.
response - the current HttpServletResponse.
url - the URL to rewrite.
type - the type of URL to be rewritten. This is one of the following values:
  • action: a standard (non-resource) URL, for which SSL is not required
  • secure-action: a standard (non-resource) URL, for which SSL is required
  • resource: a resource (e.g., image) URL, for which SSL is not required
  • secure-resource: a resource (e.g., image) URL, for which SSL is required
Returns:
the rewritten URL.
See Also:
registerURLRewriter(javax.servlet.ServletRequest, org.apache.beehive.netui.pageflow.util.URLRewriter)

rewriteURL

public static String rewriteURL(ServletContext servletContext,
                                ServletRequest request,
                                ServletResponse response,
                                String url,
                                String type,
                                boolean doEncode)
Deprecated. 
Rewrite the given URL, using the registered URLRewriter.

Parameters:
servletContext - the current ServletContext.
request - the current HttpServletRequest.
response - the current HttpServletResponse.
url - the URL to rewrite.
type - the type of URL to be rewritten. This is one of the following values:
  • action: a standard (non-resource) URL, for which SSL is not required
  • secure-action: a standard (non-resource) URL, for which SSL is required
  • resource: a resource (e.g., image) URL, for which SSL is not required
  • secure-resource: a resource (e.g., image) URL, for which SSL is required
doEncode - if true, the rewritten URL will be encoded using HttpServletResponse.encodeRedirectURL(java.lang.String).
Returns:
the rewritten URL.
See Also:
registerURLRewriter(javax.servlet.ServletRequest, org.apache.beehive.netui.pageflow.util.URLRewriter)

registerURLRewriter

public static void registerURLRewriter(ServletRequest request,
                                       URLRewriter rewriter)
Deprecated. 
Register a URLRewriter in the request. This rewriter will be used if rewriteURL(javax.servlet.ServletContext, javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String, java.lang.String) is called.

Parameters:
request - the current HttpServletRequest.
rewriter - the URLRewriter to register.

unregisterURLRewriter

public static URLRewriter unregisterURLRewriter(ServletRequest request)
Deprecated. 
Unregister the URLRewriter from the request.

Parameters:
request - the current HttpServletRequest.
Returns:
the URLRewriter that was unregistered, or null if there was none registered.
See Also:
registerURLRewriter(javax.servlet.ServletRequest, org.apache.beehive.netui.pageflow.util.URLRewriter)

getActionMappingName

public static String getActionMappingName(String action)
Deprecated. 
Return the form action converted into an action mapping path. The value of the action property is manipulated as follows in computing the name of the requested mapping:

Parameters:
action - the action name to be converted.
Returns:
an action path, suitable for lookup in the Struts configuration file.

needsSecure

public static boolean needsSecure(ServletRequest request,
                                  ServletContext context,
                                  String uri,
                                  boolean stripContextPath)
Deprecated. 
Tell whether a given URI should be written to be secure.

Parameters:
request - the current HttpServletRequest.
context - the current ServletContext.
uri - the URI to check.
stripContextPath - if true, strip the webapp context path from the URI before processing it.
Returns:
true when: false when:

allowParamsOnFormAction

public static boolean allowParamsOnFormAction(ServletContext servletContext,
                                              ServletRequest request)
Deprecated. 
Tell whether rewritten form actions should be allowed to have query parameters. If this returns false, then a form-tag implementation should render query parameters into hidden fields on the form instead of allowing them to remain in the URL.