Package org.cruxframework.crux.core.server.rest.spi

Examples of org.cruxframework.crux.core.server.rest.spi.HttpResponse$ExceptionData


      logger.warn("Failed to parse request.", e);
      return;
    }
   
    HttpRequest request = new HttpRequest(req, headers, uriInfo, method);
    HttpResponse response = new HttpResponse(res);

    boolean localeInitializedByServlet = false;
    try
    {
      localeInitializedByServlet = initUserLocaleResolver(request);
      MethodReturn methodReturn = RestDispatcher.dispatch(request, response, false);
      if (!response.isCommitted())
      {
        HttpUtil.writeResponse(request, response, methodReturn);
      }
    }
    catch (RestFailure e)
    {
      response.sendException(e.getResponseCode(), e.getResponseMessage());
      logger.error(e.getMessage(), e);
    }
    catch (Exception e)
    {
      response.sendException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server error processing request.");
      logger.error(e.getMessage(), e);
    }
    finally
    {
      if (localeInitializedByServlet)
View Full Code Here


      HttpUtil.sendError(res, HttpServletResponse.SC_BAD_REQUEST, "Failed to parse request.");
      logger.warn("Failed to parse request.", e);
      return;
    }
   
    HttpResponse response = new HttpResponse(res);
    String httpActualMethod = headers.getHeaderString(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD);
    if (httpActualMethod != null && httpActualMethod.length() > 0)
    {
      HttpRequest request = new HttpRequest(req, headers, uriInfo, httpActualMethod);
      try
      {
        RestDispatcher.dispatch(request, response, true);
      }
      catch (Exception e)
      {
        response.sendException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server error processing request.");
        logger.error(e.getMessage(), e);
      }
    }
    response.sendEmptyResponse();
    }
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.server.rest.spi.HttpResponse$ExceptionData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.