//if (context instanceof ServletContext)
//{
FacesContext facesContext;
if (externalContext instanceof ReleaseableExternalContext)
{
facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) externalContext,
this, _applicationFactory, _renderKitFactory,
_partialViewContextFactory);
}
else if (defaultExternalContext != null && defaultExternalContext instanceof ReleaseableExternalContext)
{
facesContext = new FacesContextImpl(externalContext,
(ReleaseableExternalContext) defaultExternalContext, this,
_applicationFactory, _renderKitFactory,
_partialViewContextFactory);
}
else
{
facesContext = new FacesContextImpl(externalContext, null, this,
_applicationFactory, _renderKitFactory,
_partialViewContextFactory);
}
facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());