WebDataBinderFactory binderFactory = createDataBinderFactory(bean, beanType);
HandlerMethodArgumentResolverComposite argumentResolvers = new HandlerMethodArgumentResolverComposite();
argumentResolvers.addResolvers(this.argumentResolvers);
argumentResolvers.addResolver(new NavigationContextMethodArgumentResolver(context));
ServletInvocableHandlerMethod invocable = createInvocableNavigationMethod(bean, navigationMethod.getMethod());
invocable.setDataBinderFactory(binderFactory);
invocable.setHandlerMethodArgumentResolvers(argumentResolvers);
invocable.setParameterNameDiscoverer(this.parameterNameDiscoverer);
invocable.setHandlerMethodReturnValueHandlers(this.returnValueHandlers);
ExternalContext externalContext = facesContext.getExternalContext();
ServletWebRequest request = new ServletWebRequest((HttpServletRequest) externalContext.getRequest(),
(HttpServletResponse) externalContext.getResponse());
ModelAndViewContainer modelAndViewContainer = new ModelAndViewContainer();
invocable.invokeAndHandle(request, modelAndViewContainer);
if (modelAndViewContainer.isRequestHandled()) {
return null;
}
// NOTE: in this instance we are subverting the use of the model and view container, the view here actually
// refers to the result of the method.