Dec 30th, 2010, 07:22 AM
Inject a custom AjaxHandler into FlowHandlerAdapter in a portlet environment
I am using Spring Webflow 2.2.1 in a Portlet environment.
The UI Techology is JSF1.2 with Primefaces 1.1.
I want to make use uf the primefaces buttons. For this I wanted to add the PrimeFacesAjaxHandler to handle the ajax requests from primefaces.
In the Spring documentation it says that the custom ajax handlers must be injected into the FlowHandlerAdapter.
Unfortunately there exist two FlowHandlerAdapter:
- org.springframework.webflow.mvc.servlet.FlowHandle rAdapter
- org.springframework.webflow.mvc.portlet.FlowHandle rAdapter
In my configuration I use the org.springframework.webflow.mvc.portlet.FlowHandle rAdapter and this does not have a filed ajaxHandler.
I could only inject into the org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.
Is it possible to use a custom AjaxHandler in a portlet environment?
If yes, how?
If no, why not?
Last edited by huof; Dec 30th, 2010 at 10:07 AM.
Dec 30th, 2010, 10:05 AM
In portlet env, AjaxRequest should be handled as a EventRequest!
There is a ticket for this, https://jira.springframework.org/browse/SWF-1415
Anyway, you can extent the FlowHandlerAdapter and add custom implementation. But I am not sure how to add the Ajax behaviour.
Mar 16th, 2011, 03:30 AM
Issue SWF-1415 is now solved.
But a problem remains.
How to I get my JSF 1.2 (Primefaces 1.1) UI to render the AJAX-URLs as resource URLs.
In JSP it's easy, there you can uses <portlet:resourceURL />.
Mar 23rd, 2011, 03:50 AM
I posted some remarks as a comment for SWF-1415. Regarding your question here:
you can extend the Primefaces renderers and replace their getActionURL(facesContext) by your own call to something like getPortletResourceURL(facesContext) whose purpose is to generate a resourceURL from the renderResponse. Then the client parts of the Primefaces components will emit resource URLs which enter the SWF machinery having been enhanced for treating resource URLs properly.
Mar 23rd, 2011, 03:56 AM
Thank you four your post.
I already saw your comments and had a first look at it.
Unfortunately I am currently stuck with some other issues and I did not have time up to now to got a little bit deeper into it.
But I definitely will. I will then come back to you. Maybe also with some questions
PS. I think https://jira.springsource.org/browse/SWF-1440 this should be the destination. Maybe you'd like to vote.