|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.arsdigita.dispatcher.BaseDispatcherServlet
Contains functions common to all entry-point dispatcher servlets in the core. Any dispatcher that is the first in its chain to handle an HTTP request must also be a servlet and should extend this class.
You do not need to extend this class unless your
dispatcher is also a servlet and is mounted in web.xml. In any
given ACS installation, you generally only have one servlet that is
mounted through web.xml, and that is usually the
com.arsdigita.sitenode.SiteNodeDispatcher, mapped to URL
"/".
When a request comes in:
dispatch
method.
| Field Summary | |
static String |
DISPATCHER_PREFIX_ATTR
|
static String |
ERROR_REQUEST_ATTRIBUTE
Attribute name for the URI that caused an error when the servlet container forwards to an error page. |
static String |
INCLUDE_URI
The attribute name for an included resource URI after a servlet include (nesting). |
static String |
JSP_EXCEPTION_ATTRIBUTE
Attribute name for the Throwable object saved when a JSP handles an error with the errorPage directive. |
static String |
ORIGINAL_REQUEST_ATTR
The attribute where we store the original HttpServletRequest object when we need to wrap the servlet request. |
static String |
REDIRECT_SEMAPHORE
The session attribute where we store an identifier for the previous request that made a redirect. |
static String |
REENTRANCE_ATTRIBUTE
Attribute name to indicate that the dispatcher is within a request--that is, request start listeners have run but request end listeners haven't yet. |
static String |
REQUEST_CONTEXT_ATTR
The attribute where we store the current RequestContext object. |
static String |
versionId
|
static String |
WELCOME_FILES
The application attribute (in ServletContext) where we store the list of welcome files from web.xml. |
static String |
WRAPPED_REQUEST_ATTR
The attribute where we store the wrapped servlet request object when we need to restore the original request object for a forward/include. |
| Constructor Summary | |
BaseDispatcherServlet()
|
|
| Method Summary | |
static void |
addRequestListener(RequestListener rl)
Adds a request listener to this. |
protected abstract RequestContext |
authenticateUser(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
RequestContext ctx)
A placeholder method for performing user authentication during request processing. |
protected void |
fireFinishedListener(RequestEvent evt)
Fires all finished listeners. |
protected void |
fireStartListener(RequestEvent evt)
Fires all start listeners. |
void |
init()
Reads web.xml to get the configured list of welcome files. |
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Called directly by the servlet container when this servlet is invoked from a URL request. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.arsdigita.dispatcher.Dispatcher |
dispatch |
| Field Detail |
public static final String versionId
public static final String JSP_EXCEPTION_ATTRIBUTE
public static final String ERROR_REQUEST_ATTRIBUTE
public static final String REENTRANCE_ATTRIBUTE
public static final String INCLUDE_URI
public static final String REQUEST_CONTEXT_ATTR
public static final String ORIGINAL_REQUEST_ATTR
public static final String WRAPPED_REQUEST_ATTR
public static final String REDIRECT_SEMAPHORE
public static final String WELCOME_FILES
public static final String DISPATCHER_PREFIX_ATTR
| Constructor Detail |
public BaseDispatcherServlet()
| Method Detail |
public void init()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic static void addRequestListener(RequestListener rl)
this.
rl - the RequestListener to add to the
listener list
protected abstract RequestContext authenticateUser(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
RequestContext ctx)
throws RedirectException
req - the current servlet request object
RedirectException - if the dispatcher
should redirect the client to the page contained in the exception
public void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
dispatch method as declared in implementing
subclasses.
req - the servlet requestresp - the servlet response
javax.servlet.ServletException - re-thrown when
dispatch throws an exception
IOException - re-thrown when dispatch
throws an IOExceptionprotected void fireFinishedListener(RequestEvent evt)
evt - the current RequestEvent to broadcast to all event
listenersprotected void fireStartListener(RequestEvent evt)
evt - the current RequestEvent to broadcast to all event
listeners
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||