java.lang.Object
com.aoapps.servlet.http.Includer
Performs an include while allowing SkipPageException and sendError to escape
the include. This is required to support redirecting from within an included
page.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
dispatchInclude
(RequestDispatcher dispatcher, HttpServletRequest request, HttpServletResponse response) Performs the actual include, supporting propagation of SkipPageException and sendError.static void
sendError
(HttpServletRequest request, HttpServletResponse response, int status) Sends an error.static void
sendError
(HttpServletRequest request, HttpServletResponse response, int status, String message) Sends an error.static void
setLocation
(HttpServletRequest request, HttpServletResponse response, String location) Sets a Location header.static void
setPageSkipped
(ServletRequest request) Sets the skip page flag.
-
Method Details
-
dispatchInclude
public static void dispatchInclude(RequestDispatcher dispatcher, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SkipPageException Performs the actual include, supporting propagation of SkipPageException and sendError.When
response is committed
will not callHttpServletResponse.sendError(int, java.lang.String)
. -
setLocation
public static void setLocation(HttpServletRequest request, HttpServletResponse response, String location) Sets a Location header. When not in an included page, calls setHeader directly. When inside of an include will set request attribute so outermost include can call setHeader. Encodes the location to US-ASCII format. -
sendError
public static void sendError(HttpServletRequest request, HttpServletResponse response, int status, String message) throws IOException Sends an error. When not in an included page, calls sendError directly. When inside of an include will set request attribute so outermost include can call sendError.When
response is committed
will not callHttpServletResponse.sendError(int, java.lang.String)
.- Throws:
IOException
-
sendError
public static void sendError(HttpServletRequest request, HttpServletResponse response, int status) throws IOException Sends an error. When not in an included page, calls sendError directly. When inside of an include will set request attribute so outermost include can call sendError.When
response is committed
will not callHttpServletResponse.sendError(int)
.- Throws:
IOException
-
setPageSkipped
Sets the skip page flag.
-