HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
RequestContext requestContext = new ServletRequestContext(request);
ResponseContext responseContext = null;
RequestHandler handler = null;
try {
RequestHandlerFactory factory = RequestHandlerFactory.INSTANCE; // TODO: improve this
if (factory != null)
handler = factory.newRequestHandler(requestContext);
if (handler != null) {
responseContext = handler.invoke(requestContext);
} else {
throw new MethodNotAllowedException(request.getMethod());
}
} catch (AbderaServerException exception) {
responseContext = exception;