Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide custom namespace element(s) to simplify configuration required for processing JSF 2 requests. [SWF-1375] #561

Closed
spring-operator opened this issue Aug 4, 2010 · 3 comments
Assignees
Milestone

Comments

@spring-operator
Copy link
Contributor

spring-operator commented Aug 4, 2010

Rossen Stoyanchev opened SWF-1375 and commented


Affects: 2.1.1

Issue Links:

@spring-operator
Copy link
Contributor Author

Erwin Vervaet commented

Wouldn't it be better to provide a custom namespace element to do all required configuration to set SWF up for use with JSF 2?
For instance:

  • FacesJsfResourceRequestHandler
  • JsfAjaxHandler
  • FlowFacesContextLifecycleListener
  • ...

@spring-operator
Copy link
Contributor Author

Rossen Stoyanchev commented

I agree that would be a worthwhile goal. For example adding this element should plug in all additional configuration required for processing JSF 2 requests:

faces:jsf-request-handling/

That raises a couple of extra questions:

  1. An AjaxHandler may be set on a FlowHandlerAdapter but also on FlowController of which there could be more than one. A reasonable default for that might be set all FlowControllers and allow customizing the list of FlowController bean id's.

  2. Since FlowExecutor instances are typically defined with a custom namespace element, faces:jsf-request-handling/ would have to appear below any flow:executor/ elements. However relying on the order of elements is unusual in Spring configuration. The only other solution I see is providing a faces:flow-executor.

@spring-operator
Copy link
Contributor Author

Rossen Stoyanchev commented

  1. A <faces:resources /> custom namespace element is now available that is equivalent to this configuration:

<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="order" value="0"/>
<property name="mappings" value="/javax.faces.resource/**=jsfResourceHandler"/>
</bean>
<bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter" />
<bean id="jsfResourceHandler" class="org.springframework.faces.webflow.FacesJsfResourceRequestHandler"/>
2. JsfFlowHandlerAdapter can now be used instead of FlowHandlerAdapter to ensure a JsfAjaxHandler is used by default with JSF 2.

  1. An IllegalStateException with a helpful message is thrown if FacesContext is null when processing a Web Flow request to suggest configuring a FlowFacesContextLifecycleListener.

Note that #2 and #3 were not covered by any custom namespace elements. Hopefully the provided solution is a good balance between simple and flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants