java.lang.Object
com.aoapps.servlet.ServletUtil
Static utilities that may be useful by servlet/JSP/taglib environments.
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SkipPageException
A sharedSkipPageException
instance to avoid exception creation overhead for the routine operation of skipping pages. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getRequestEncoding
(ServletRequest request) Gets the request encoding or ISO-8859-1 when not available.static void
setContentType
(ServletResponse response, String contentType, String characterEncoding) Sets the response content type.static void
setContentType
(ServletResponse response, String contentType, Charset characterEncoding) Sets the response content type.
-
Field Details
-
SKIP_PAGE_EXCEPTION
A sharedSkipPageException
instance to avoid exception creation overhead for the routine operation of skipping pages.
-
-
Method Details
-
getRequestEncoding
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
-