- java.lang.Object
-
- com.aoapps.servlet.ServletUtil
-
public class ServletUtil extends Object
Static utilities that may be useful by servlet/JSP/taglib environments.- Author:
- AO Industries, Inc.
- See Also:
HttpServletUtil
-
-
Field Summary
Fields Modifier and Type Field Description static SkipPageExceptionSKIP_PAGE_EXCEPTIONA sharedSkipPageExceptioninstance to avoid exception creation overhead for the routine operation of skipping pages.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetRequestEncoding(ServletRequest request)Gets the request encoding or ISO-8859-1 when not available.static voidsetContentType(ServletResponse response, String contentType, String characterEncoding)Sets the response content type.static voidsetContentType(ServletResponse response, String contentType, Charset characterEncoding)Sets the response content type.
-
-
-
Field Detail
-
SKIP_PAGE_EXCEPTION
public static final SkipPageException SKIP_PAGE_EXCEPTION
A sharedSkipPageExceptioninstance to avoid exception creation overhead for the routine operation of skipping pages.
-
-
Method Detail
-
getRequestEncoding
public static String getRequestEncoding(ServletRequest request)
Gets the request encoding or ISO-8859-1 when not available.
-
setContentType
public static void setContentType(ServletResponse response, String contentType, String characterEncoding) throws ServletException
Sets the response content type. UnlikeServletResponse.setContentType(java.lang.String), throws an exception when unable to set the content type.- Throws:
ServletException- when unable to change the content type
-
setContentType
public static void setContentType(ServletResponse response, String contentType, Charset characterEncoding) throws ServletException
Sets the response content type. UnlikeServletResponse.setContentType(java.lang.String), throws an exception when unable to set the content type.- Throws:
ServletException- when unable to change the content type
-
-