// Register the default URLRewriter
URLRewriterService.registerURLRewriter(0, request, new DefaultURLRewriter());
ServletContext ctxt = getServletContext();
Command xhrServletCommand = null;
CatalogFactory catalogFactory = CatalogFactory.getInstance();
if(catalogFactory != null && catalogFactory.getCatalog() != null) {
xhrServletCommand = catalogFactory.getCatalog().getCommand(COMMAND_XHR);
}
// execute the Command if found or the interceptors if found
if(xhrServletCommand != null) {
/* todo: add a chain to create the Context object */
WebChainContext webChainContext = new WebChainContext(ctxt, request, response);
try {
xhrServletCommand.execute(webChainContext);
}
catch(Exception e) {
ServletUtils.throwServletException(e);
}
}