|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.chwf.servlet.ServletUtils
Class with utility methods for servlets and JSP.
Field Summary | |
static int |
EVAL_BODY_TAG
BodyTag.EVAL_BODY_TAG. |
static java.lang.String |
EXCEPTION_CACHE_NAME
The name used to cache errors. |
Constructor Summary | |
ServletUtils()
|
Method Summary | |
static void |
cacheError(javax.servlet.http.HttpServletRequest request,
java.lang.Throwable error)
Cached an error in the request. |
static java.lang.String |
encode(java.lang.String value)
Place holder to deal with deprecated java.net.URLEncoder.encode() in JDK 1.4. |
static void |
forward(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String uri)
Forward to the indicated URI. |
static java.lang.StringBuffer |
getURLWithQueryString(javax.servlet.http.HttpServletRequest request)
Get the URL, as per HttpUtils.getRequestURL() , and append
the query string. |
static void |
include(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String uri)
Include the indicated URI. |
static java.lang.Throwable |
retrieveError(javax.servlet.http.HttpServletRequest request)
Retrieves a cached error from the request. |
static void |
setPageAttribute(javax.servlet.jsp.PageContext context,
java.lang.String key,
java.lang.Object value)
Utility method to compensate for the "feature" of PageContext that it throws a NullPointerException when setting a null attribute value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String EXCEPTION_CACHE_NAME
public static final int EVAL_BODY_TAG
Constructor Detail |
public ServletUtils()
Method Detail |
public static void cacheError(javax.servlet.http.HttpServletRequest request, java.lang.Throwable error)
request
- The request.error
- The error.public static java.lang.Throwable retrieveError(javax.servlet.http.HttpServletRequest request)
request
- The request.public static java.lang.String encode(java.lang.String value)
value
- The value to encode.public static void forward(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String uri) throws javax.servlet.ServletException, java.io.IOException
request
- The request.response
- The response.uri
- The target URI.javax.servlet.ServletException
- For servlet exceptions, or if the URI is not foundjava.io.IOException
- For IO exceptions.public static void include(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String uri) throws javax.servlet.ServletException, java.io.IOException
request
- The request.response
- The response.uri
- The target URI.javax.servlet.ServletException
- For servlet exceptions, or if the URI is not foundjava.io.IOException
- For IO exceptions.public static java.lang.StringBuffer getURLWithQueryString(javax.servlet.http.HttpServletRequest request)
HttpUtils.getRequestURL()
, and append
the query string.request
- The request.public static void setPageAttribute(javax.servlet.jsp.PageContext context, java.lang.String key, java.lang.Object value) throws java.lang.NullPointerException
context
- The page context.key
- The key value.value
- The attribute value.java.lang.NullPointerException
- If the key is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |