Java Code Examples for javax.faces.context.FacesContext.getResponseComplete()

The following are Jave code examples for showing how to use getResponseComplete() of the javax.faces.context.FacesContext class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: myfaces-trinidad   File: SkinPregenerationService.java   Source Code and License Vote up 6 votes
@Override
public void renderView(FacesContext context, UIViewRoot viewToRender)
  throws IOException, FacesException
{
  if (!isEnabled())
  {
    _sendPregenerationDisabledError(context);
    return;
  }
  
  long duration = _pregenerateSkin(context);    
  
  if (!context.getResponseComplete())
  {
    _renderResponse(context, duration);
  }
}
 
Example 2
Project: myfaces-trinidad   File: SkinPregenerationService.java   Source Code and License Vote up 6 votes
private static void _sendError(FacesContext context, String message)
{
  if (context.getResponseComplete())
  {
    return;
  }

  ExternalContext external = context.getExternalContext();
  
  try
  {
    external.responseSendError(500, message);
  }
  catch (IOException e)
  {
    _LOG.warning(e);
  }
  finally
  {
    context.responseComplete();
  }
}