Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public class Dispatcher extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ARG_MAP_REQUEST_ATTRIBUTE_NAME
The name of the request-scope Map that will contain the arguments for the current page.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
forward(ServletContext servletContext,
String page,
HttpServletRequest request,
HttpServletResponse response) |
static void |
forward(ServletContext servletContext,
String page,
HttpServletRequest request,
HttpServletResponse response,
Map<String,?> args)
Performs a forward, allowing page-relative paths and setting all values
compatible with <ao:forward> tag.
|
static String |
getCurrentPagePath(HttpServletRequest request)
Gets the current page path, including any effects from include/forward.
|
static String |
getDispatchedPage(ServletRequest request)
Gets the current-thread dispatched page or null if not set.
|
static String |
getOriginalPage(ServletRequest request)
Gets the current request original page or null if not set.
|
static String |
getOriginalPagePath(HttpServletRequest request)
Gets the original page path corresponding to the original request before any forward/include.
|
static void |
include(ServletContext servletContext,
String page,
HttpServletRequest request,
HttpServletResponse response) |
static void |
include(ServletContext servletContext,
String page,
HttpServletRequest request,
HttpServletResponse response,
Map<String,?> args)
Performs an include, allowing page-relative paths and setting all values
compatible with <ao:include> tag.
|
static void |
setDispatchedPage(ServletRequest request,
String dispatchedPage)
Sets the current-thread dispatched page.
|
static void |
setOriginalPage(ServletRequest request,
String page)
Sets the current request original page.
|
public static final String ARG_MAP_REQUEST_ATTRIBUTE_NAME
public static String getOriginalPage(ServletRequest request)
public static void setOriginalPage(ServletRequest request, String page)
public static String getOriginalPagePath(HttpServletRequest request)
public static String getDispatchedPage(ServletRequest request)
public static void setDispatchedPage(ServletRequest request, String dispatchedPage)
public static String getCurrentPagePath(HttpServletRequest request)
public static void forward(ServletContext servletContext, String page, HttpServletRequest request, HttpServletResponse response, Map<String,?> args) throws ServletException, IOException
args - The arguments for the page, make unmodifiable and accessible as request-scope var "arg"ServletExceptionIOExceptionpublic static void forward(ServletContext servletContext, String page, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
public static void include(ServletContext servletContext, String page, HttpServletRequest request, HttpServletResponse response, Map<String,?> args) throws SkipPageException, ServletException, IOException
args - The arguments for the page, make unmodifiable and accessible as request-scope var "arg"SkipPageException - when the included page has been skipped due to a redirect.ServletExceptionIOExceptionpublic static void include(ServletContext servletContext, String page, HttpServletRequest request, HttpServletResponse response) throws SkipPageException, ServletException, IOException
Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.