- java.lang.Object
-
- com.aoapps.servlet.http.Includer
-
public class Includer extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddispatchInclude(RequestDispatcher dispatcher, HttpServletRequest request, HttpServletResponse response)Performs the actual include, supporting propagation of SkipPageException and sendError.static voidsendError(HttpServletRequest request, HttpServletResponse response, int status)static voidsendError(HttpServletRequest request, HttpServletResponse response, int status, String message)Sends an error.static voidsetLocation(HttpServletRequest request, HttpServletResponse response, String location)Sets a Location header.static voidsetPageSkipped(ServletRequest request)Sets the skip page flag.
-
-
-
Method Detail
-
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.
-
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.- Throws:
IOException
-
sendError
public static void sendError(HttpServletRequest request, HttpServletResponse response, int status) throws IOException
- Throws:
IOException
-
setPageSkipped
public static void setPageSkipped(ServletRequest request)
Sets the skip page flag.
-
-