*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// Define local variables we will need
Command command = null;
boolean result = false;
// Construct and store a new Context for this request
ShaleWebContext context =
new ShaleWebContext(this.context,
(HttpServletRequest) request,
(HttpServletResponse) response);
request.setAttribute(CONTEXT_ATTR, context);
// Invoke the "preprocess" command (if any is defined). If this
// command returns true, the response has been completed already
// so we do NOT invoke the actual application.
command = catalog.getCommand(COMMAND_PREPROCESS);
if (command != null) {
try {
result = command.execute(context);
} catch (IOException e) {
throw e;
} catch (ServletException e) {
throw e;
} catch (Exception e) {
throw new ServletException(e);
}
if (result) {
// Clean up the stored request attribute
request.removeAttribute(CONTEXT_ATTR);
// Bypass calling the remainder of the application
return;
}
}
// Invoke the remainder of the processing for this request
// (which will typically be the JSF controller servlet)
chain.doFilter(request, response);
// Invoke the "postprocess" command (if any is defined).
command = catalog.getCommand(COMMAND_POSTPROCESS);
if (command != null) {
try {
command.execute(context);
} catch (IOException e) {
throw e;
} catch (ServletException e) {
throw e;
} catch (Exception e) {