HttpServletResponse response) throws ServletException,
IOException {
LifecycleFactory lFactory = (LifecycleFactory)
FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
Lifecycle lifecycle =
lFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
FacesContextFactory fcFactory = (FacesContextFactory)
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
FacesContext facesContext =
fcFactory.getFacesContext(getServletContext(), request, response, lifecycle);
try {
Application application = facesContext.getApplication();
ViewHandler viewHandler = application.getViewHandler();
String viewId = getFromViewId();
UIViewRoot view = viewHandler.createView(facesContext, viewId);
facesContext.setViewRoot(view);
// ExternalContext externalContext = facesContext.getExternalContext();
// externalContext.getRequestMap().put("com.sun.faces.INVOCATION_PATH", "/faces");
// invoke application
String outcome = invokeApplication(facesContext);
if (facesContext.getResponseComplete()) {
return;
}
if (LOG.isDebugEnabled()) {
LOG.debug("outcome = '" + outcome + "'");
}
NavigationHandler navigationHandler = application.getNavigationHandler();
navigationHandler.handleNavigation(facesContext, null, outcome);
lifecycle.render(facesContext);
} finally {
facesContext.release();
}
}