|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javawebparts.filter.FilterHelpers
This class contains static methods that are used by a number of different filters.
Field Summary | |
private static org.apache.commons.logging.Log |
log
Log instance. |
Constructor Summary | |
private |
FilterHelpers()
This is a utility class, so we want a private noarg constructor so instances cannot be created. |
Method Summary | |
static void |
checkRedirectForwardTo(java.lang.String filterName,
java.lang.String redirectTo,
java.lang.String forwardTo)
For filters that support the redirectTo and forwardTo init parameters, only one or the other can be specified, never both, and at least one must be specified. |
static boolean |
filterPath(javax.servlet.ServletRequest request,
java.util.ArrayList pathList,
java.lang.String inPathSpec)
Determines whether a filter should do its work. |
static java.lang.String |
initForwardTo(javax.servlet.FilterConfig filterConfig)
Gets the forwardTo init parameter that is common to many filters. |
static java.util.ArrayList |
initPathList(java.lang.String filterName,
javax.servlet.FilterConfig filterConfig)
This is a common function used by a number of filters to get the list of paths the filter will function or not function on. |
static java.lang.String |
initPathSpec(java.lang.String filterName,
javax.servlet.FilterConfig filterConfig)
This is a common function used by a number of filters to get the init parameter that describes the path list. |
static java.lang.String |
initRedirectTo(javax.servlet.FilterConfig filterConfig)
Gets the redirectTo init parameter that is common to many filters. |
static void |
redirectOrForward(java.lang.String redirectTo,
java.lang.String forwardTo,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
This is called by any filter after it determines that a request should be aborted. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static org.apache.commons.logging.Log log
Constructor Detail |
private FilterHelpers()
Method Detail |
public static java.lang.String initPathSpec(java.lang.String filterName, javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
filterName
- The name of the filter calling this function.
This is for logging purposes.filterConfig
- The filterConfig instance associated with the
filter.
javax.servlet.ServletException
- If anything goes wrong.public static java.util.ArrayList initPathList(java.lang.String filterName, javax.servlet.FilterConfig filterConfig)
filterName
- The name of the filter calling this function.
This is for logging purposes.filterConfig
- The filterConfig instance associated with the
filter.
public static java.lang.String initRedirectTo(javax.servlet.FilterConfig filterConfig)
filterConfig
- The filterConfig instance associated with the filter.
public static java.lang.String initForwardTo(javax.servlet.FilterConfig filterConfig)
filterConfig
- The filterConfig instance associated with the filter.
public static void checkRedirectForwardTo(java.lang.String filterName, java.lang.String redirectTo, java.lang.String forwardTo) throws javax.servlet.ServletException
filterName
- The name of the filter calling this check.redirectTo
- The value of the redirectTo init param.forwardTo
- The value of the forwardTo init param.
javax.servlet.ServletException
- If the tests are not passed.public static boolean filterPath(javax.servlet.ServletRequest request, java.util.ArrayList pathList, java.lang.String inPathSpec)
request
- ServlerRequest object.pathList
- The ArrayList containing the lists of paths to either
include or exclude.inPathSpec
- Whether the paths are included or excluded.
public static void redirectOrForward(java.lang.String redirectTo, java.lang.String forwardTo, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, java.io.IOException
redirectTo
- The URL to redirect to, if specified.forwardTo
- The URL to forward to, if specified.request
- The current request.response
- The current response.
javax.servlet.ServletException
- If anything goes wrong.
java.io.IOException
- If anything goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |