//constructor, because the delegate ExternalContext do
//calls like dispatch, forward and redirect, that requires
//the wrapped response instance to work properly.
AddResource addResource = AddResourceFactory.getInstance((HttpServletRequest)request,(ServletContext)context);
if (addResource.requiresBuffer())
{
ExtensionsResponseWrapper extensionsResponseWrapper = new ExtensionsResponseWrapper((HttpServletResponse)response);
return new TomahawkFacesContextWrapper(delegate.getFacesContext(context, request, extensionsResponseWrapper, lifecycle),
extensionsResponseWrapper);
}