Process an incoming request, and create the
corresponding response according to the following specification.
If the request
and response
arguments to this method are not
instances of HttpServletRequest
and HttpServletResponse
,
respectively, the results of invoking this method are undefined.
This method must respond to requests that contain
the following strings by invoking the sendError
method on the response argument
(cast to HttpServletResponse
), passing the code
HttpServletResponse.SC_NOT_FOUND
as the argument.
/WEB-INF/
/WEB-INF
/META-INF/
/META-INF
If none of the cases described above in the specification for this method apply to the
servicing of this request, the following action must be taken to service the request.
Acquire a
FacesContext instance for this request.
Acquire the ResourceHandler
for this request by calling
javax.faces.application.Application#getResourceHandler. Call
javax.faces.application.ResourceHandler#isResourceRequest.
If this returns true
call
javax.faces.application.ResourceHandler#handleResourceRequest.
If this returns false
, call
javax.faces.lifecycle.Lifecycle#attachWindow
followed by
javax.faces.lifecycle.Lifecycle#execute followed by
javax.faces.lifecycle.Lifecycle#render.
If a
javax.faces.FacesException is thrown in either case, extract the cause from the FacesException
.
If the cause is null
extract the message from the FacesException
, put it inside
of a new ServletException
instance, and pass the FacesException
instance as the root cause, then rethrow the ServletException
instance.
If the cause is an instance of ServletException
, rethrow the cause.
If the cause is an instance of IOException
, rethrow the cause.
Otherwise, create a new ServletException
instance, passing the message from the cause, as the first
argument, and the cause itself as the second argument.
The implementation must make it so
javax.faces.context.FacesContext#release is called
within a finally block as late as possible in the processing for the JSF related portion of
this request.