* the application code to which the request facade is being passed.
* For example, the request.facade's getContextPath() method will
* return "/", rather than the context root of the default-web-module,
* in this case.
*/
RequestFacade hreq = (RequestFacade) request.getRequest(true);
HttpServletResponse hres =
(HttpServletResponse) response.getResponse();
// Check for the application being marked unavailable
if (!context.getAvailable()) {
/* S1AS 4878272
hres.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE,
sm.getString("standardContext.isUnavailable"));
*/
// BEGIN S1AS 4878272
hres.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
response.setDetailMessage(sm.getString("standardContext.isUnavailable"));
// END S1AS 4878272
unavailable = true;
}
// Check for the servlet being marked unavailable
if (!unavailable && wrapper.isUnavailable()) {
log(sm.getString("standardWrapper.isUnavailable",
wrapper.getName()));
if (hres == null) {
; // NOTE - Not much we can do generically
} else {
long available = wrapper.getAvailable();
if ((available > 0L) && (available < Long.MAX_VALUE)) {
hres.setDateHeader("Retry-After", available);
/* S1AS 4878272
hres.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE,
sm.getString("standardWrapper.isUnavailable",
wrapper.getName()));
*/
// BEGIN S1AS 4878272
hres.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
response.setDetailMessage(
sm.getString("standardWrapper.isUnavailable",
wrapper.getName()));
// END S1AS 4878272
} else if (available == Long.MAX_VALUE) {
/* S1AS 4878272
hres.sendError(HttpServletResponse.SC_NOT_FOUND,
sm.getString("standardWrapper.notFound",
wrapper.getName()));
*/
// BEGIN S1AS 4878272
hres.sendError(HttpServletResponse.SC_NOT_FOUND);
response.setDetailMessage(
sm.getString("standardWrapper.notFound",
wrapper.getName()));
// END S1AS 4878272
}
}
unavailable = true;
}
// Allocate a servlet instance to process this request
try {
if (!unavailable) {
servlet = wrapper.allocate();
}
} catch (UnavailableException e) {
if (e.isPermanent()) {
/* S1AS 4878272
hres.sendError(HttpServletResponse.SC_NOT_FOUND,
sm.getString("standardWrapper.notFound",
wrapper.getName()));
*/
// BEGIN S1AS 4878272
hres.sendError(HttpServletResponse.SC_NOT_FOUND);
response.setDetailMessage(
sm.getString("standardWrapper.notFound",
wrapper.getName()));
// END S1AS 4878272
} else {
hres.setDateHeader("Retry-After", e.getUnavailableSeconds());
/* S1AS 4878272
hres.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE,
sm.getString("standardWrapper.isUnavailable",
wrapper.getName()));
*/
// BEGIN S1AS 4878272
hres.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
response.setDetailMessage(
sm.getString("standardWrapper.isUnavailable",
wrapper.getName()));
// END S1AS 4878272
}
} catch (ServletException e) {
log(sm.getString("standardWrapper.allocateException",
wrapper.getName()),
StandardWrapper.getRootCause(e));
throwable = e;
exception(request, response, e);
servlet = null;
} catch (Throwable e) {
log(sm.getString("standardWrapper.allocateException",
wrapper.getName()), e);
throwable = e;
exception(request, response, e);
servlet = null;
}
// Acknowlege the request
try {
response.sendAcknowledgement();
} catch (IOException e) {
log(sm.getString("standardWrapper.acknowledgeException",
wrapper.getName()), e);
throwable = e;
exception(request, response, e);
} catch (Throwable e) {
log(sm.getString("standardWrapper.acknowledgeException",
wrapper.getName()), e);
throwable = e;
exception(request, response, e);
servlet = null;
}
MessageBytes requestPathMB = null;
if (hreq != null) {
requestPathMB = hrequest.getRequestPathMB();
}
hreq.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,
requestPathMB);
// Create the filter chain for this request
ApplicationFilterFactory factory =
ApplicationFilterFactory.getInstance();
ApplicationFilterChain filterChain =
factory.createFilterChain((ServletRequest) request,
wrapper, servlet);
// Call the filter chain for this request
// NOTE: This also calls the servlet's service() method
try {
String jspFile = wrapper.getJspFile();
if (jspFile != null) {
hreq.setAttribute(Globals.JSP_FILE_ATTR, jspFile);
}
/* IASRI 4665318
if ((servlet != null) && (filterChain != null)) {
filterChain.doFilter(hreq, hres);
}