}
public void render(final Map model, final HttpServletRequest servletRequest,
final HttpServletResponse servletResponse) throws Exception
{
final SynchronousDispatcher dispatcher = (SynchronousDispatcher)deployment.getDispatcher();
ResteasyWebHandlerTemplate template = new ResteasyWebHandlerTemplate<Void>(dispatcher.getProviderFactory())
{
protected Void handle(ResteasyRequestWrapper requestWrapper,
HttpResponse response) throws Exception
{
HttpRequest httpRequest = requestWrapper.getHttpRequest();
dispatcher.pushContextObjects(httpRequest, response);
try
{
try
{
MediaType resolvedContentType = resolveContentType(httpRequest,
httpRequest.getHttpHeaders().getMediaType());
BuiltResponse responseInvoker = getResponse(model, resolvedContentType);
if (responseInvoker != null)
{
ServerResponseWriter.writeNomapResponse(responseInvoker, httpRequest, response, dispatcher.getProviderFactory());
}
}
catch (Exception e)
{
dispatcher.writeException(httpRequest, response, e);
}
return null;
}
finally
{
dispatcher.clearContextData();
}
}
};
ResteasyRequestWrapper requestWrapper = RequestUtil.getRequestWrapper(servletRequest);
template.handle(requestWrapper, servletResponse);