Hi spsaran,
I did exactly the same.
So you have the same problem?
I am currently very frustrated.
I debugged Tiles and I do not find a small hint what may go wrong.
Regards,
Florian
Hi spsaran,
I did exactly the same.
So you have the same problem?
I am currently very frustrated.
I debugged Tiles and I do not find a small hint what may go wrong.
Regards,
Florian
Yeah. The problem is in TilesConfigurer which is only ServletAware not PorletAware.
I try to create the PortletTilesRequestContext through factory but there is no portlet tiles context. TilesCongurer creates only ServletTilesApplicationContext. I am not sure whether we can extend the TilesConfigurer as a PorletAware and use it. It may lead some other problem.
For quick fix i extended FlowAjaxTilesView and used in tilesViewResolver as a view class, but rendering fragments is not working as expected.
Fragment is not working because of ajaxSource is missing in render phase!Code:public class PortletFlowAjaxTilesView extends FlowAjaxTilesView { protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { ServletUtil.setForceInclude(request, true); super.renderMergedOutputModel(model, request, response); } }
Tiles should not have to be aware of the Portlet environment when running withing Spring Portlet MVC. Please see the documentation on the ViewRendererServlet especially the comments about the reuse of all the existing Servlet-based view types.
Since it is ServletAware, the ServletTilesRequestContext is initialized and used and its dispatch is,
The dispatch method calls forward(path) when its portlet and its return empty content. I have set the forceInclude true in PortletFlowAjaxTilesView and include called. The include is working.Code:public void dispatch(String path) throws IOException { if (response.isCommitted() || ServletUtil.isForceInclude(request)) { include(path); } else { forward(path); } }
Then the issue in fragment rendering also. SpringJavascriptAjaxHandler checks isAjaxRequest based on ajaxSource request parameter. Since portlet is in rendering phase this parameter is not availble and failed to consider as Ajax request!
So Spring Webflow + Tiles in Portlet env is not working
Please let us know if we missed any configuration or need to do any custom coding to achieve this!
Note: I am using Spring 3.0.3 + Webflow 2.1.0 and Tiles 2.1.2 in WebLogic Portal 10.3.2 environment.
I did a test by modifying the booking-portlet-mvc sample. TilesView exposes a few standard forward request attributes in case the servlet container doesn't properly do that itself. This is based on the flag exposeForwardAttributes, which is set to true for pre-2.5 servlet container.
When TilesView exposes these attributes the forward works ok. So my guess is that the container I'm using Pluto 2.x does not do that itself. You can try to set this flag to true by overriding TilesView.initServletContext(ServletContext).
Rossen, Thanks for the reply.
WebLogic Portal 10.3.2 uses Servlet Container 2.5, so TileView has the default value false for exposeForwardAttributes.
I have changed this as true through debug window and its rendering!
Issue 1: exposeForwardAttributes is private and no public setter! So I could not override!
Issue 2: When you render fragment, its consider as Ajax request comes with parameter ajaxSource. But in portlet rendering phase ajaxSource parameter is not available and loads whole page instead fragments.
So (ajaxHandler.isAjaxRequest(request, response)) (line:83) is false in AjaxTileView and rendering whole page. Is this fixed in any latest version?
Thanks again.
You can open a ticket in the Spring JIRA.
Ajax requests are meant to be handled as event requests. That's the goal of this ticket:
https://jira.springframework.org/browse/SWF-1415
The sample JSF/Webflow/Portlet in the distribution is not deployable to either Pluto or Liferay, this issue should not be resolved. Have any recent efforts been made to integrate with Myfaces portlet bridge (JSR-301).