Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.struts.adapter.util.rewriter
Class StrutsURLRewriterService

    java.lang.Object
      com.bea.struts.adapter.util.rewriter.StrutsURLRewriterService

    public class StrutsURLRewriterService

extends Object

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

Constructor Summary
`StrutsURLRewriterService()`

Method Summary
`static String` | `createActionURL(javax.servlet.jsp.PageContext pageContext, String action, String type)`
`static String` | `getActionMappingName(String action)` Return the form action converted into an action mapping path.
`static StrutsURLRewriter` | `getDefaultRewriter()` Deprecated there is no longer a default non-abstract version of StrutsURLRewriter
`protected static StrutsURLRewriter` | `getRewriter(javax.servlet.ServletRequest request)`
`static boolean` | `isStandAloneForward(javax.servlet.ServletRequest request)` Used to determine whether or not a tag is to be rendered within a nested environment, such as a portal.
`static void` | `registerURLRewriter(javax.servlet.ServletRequest request, StrutsURLRewriter rewriter)` Register a StrutsURLRewriter in the request.
`static String` | `rewriteName(javax.servlet.ServletContext servletContext, javax.servlet.ServletRequest request, String name)` Rewrite the given parameter name, using the registered StrutsURLRewriter.
`static String` | `rewriteURL(javax.servlet.ServletContext servletContext, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String url, String type)` Rewrite the given URL, using the registered StrutsURLRewriter.
`static String` | `rewriteURL(javax.servlet.ServletContext servletContext, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String url, String type, boolean doEncode)` Rewrite the given URL, using the registered StrutsURLRewriter.
`static StrutsURLRewriter` | `unregisterURLRewriter(javax.servlet.ServletRequest request)` Unregister the StrutsURLRewriter from the request.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StrutsURLRewriterService

    public StrutsURLRewriterService()

Method Detail

### getDefaultRewriter

    @Deprecated
    public static StrutsURLRewriter getDefaultRewriter()

  Deprecated there is no longer a default non-abstract version of StrutsURLRewriter

  Get the default StrutsURLRewriter.

  Returns
    null as there is no longer a default non-abstract version of StrutsURLRewriter

### rewriteName

    public static String rewriteName(javax.servlet.ServletContext servletContext,
                                     javax.servlet.ServletRequest request,
                                     String name)

  Rewrite the given parameter name, using the registered StrutsURLRewriter.

  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(javax.servlet.ServletContext servletContext,
                                    javax.servlet.ServletRequest request,
                                    javax.servlet.ServletResponse response,
                                    String url,
                                    String type)

  Rewrite the given URL, using the registered StrutsURLRewriter.

  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, com.bea.struts.adapter.util.rewriter.StrutsURLRewriter)`

### rewriteURL

    public static String rewriteURL(javax.servlet.ServletContext servletContext,
                                    javax.servlet.ServletRequest request,
                                    javax.servlet.ServletResponse response,
                                    String url,
                                    String type,
                                    boolean doEncode)

  Rewrite the given URL, using the registered StrutsURLRewriter.

  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, com.bea.struts.adapter.util.rewriter.StrutsURLRewriter)`

### registerURLRewriter

    public static void registerURLRewriter(javax.servlet.ServletRequest request,
                                           StrutsURLRewriter rewriter)

  Register a StrutsURLRewriter 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 StrutsURLRewriter to register.

### unregisterURLRewriter

    public static StrutsURLRewriter unregisterURLRewriter(javax.servlet.ServletRequest request)

  Unregister the StrutsURLRewriter from the request.

  Parameters
    `request` - the current HttpServletRequest.
  Returns
    the StrutsURLRewriter that was unregistered, or `null` if there was none registered.
  See Also
    `registerURLRewriter(javax.servlet.ServletRequest, com.bea.struts.adapter.util.rewriter.StrutsURLRewriter)`

### createActionURL

    public static String createActionURL(javax.servlet.jsp.PageContext pageContext,
                                         String action,
                                         String type)

### isStandAloneForward

    public static boolean isStandAloneForward(javax.servlet.ServletRequest request)

  Used to determine whether or not a tag is to be rendered within a nested environment, such as a portal.

  Parameters
    `request` - the current `ServletRequest`
  Returns
    whether or not a forward is for an non-Portlet application or not

### getActionMappingName

    public static String getActionMappingName(String action)

  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:
  - Any filename extension is removed (on the theory that extension mapping is being used to select the controller servlet).
  - If the resulting value does not start with a slash, then a slash is prepended.

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

### getRewriter

    protected static StrutsURLRewriter getRewriter(javax.servlet.ServletRequest request)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.