Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Webflow with JSP/Tiles - Portlet has no content

  1. #11
    Join Date
    Nov 2010
    Location
    Winterthur
    Posts
    49

    Default

    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

  2. #12
    Join Date
    Apr 2010
    Location
    New Jersey, NJ
    Posts
    42

    Default

    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.

    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);
    	}
    	
    }
    Fragment is not working because of ajaxSource is missing in render phase!

  3. #13
    Join Date
    Aug 2006
    Location
    Brooklyn
    Posts
    556

    Default

    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.

  4. #14
    Join Date
    Apr 2010
    Location
    New Jersey, NJ
    Posts
    42

    Default

    Since it is ServletAware, the ServletTilesRequestContext is initialized and used and its dispatch is,

    Code:
        public void dispatch(String path) throws IOException {
            if (response.isCommitted() || ServletUtil.isForceInclude(request)) {
                include(path);
            } else {
                forward(path);
            }
        }
    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.

    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.

  5. #15
    Join Date
    Aug 2006
    Location
    Brooklyn
    Posts
    556

    Default

    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).

  6. #16
    Join Date
    Apr 2010
    Location
    New Jersey, NJ
    Posts
    42

    Default

    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.

  7. #17
    Join Date
    Aug 2006
    Location
    Brooklyn
    Posts
    556

    Default

    Quote Originally Posted by spsaran View Post
    Issue 1: exposeForwardAttributes is private and no public setter! So I could not override!
    You can open a ticket in the Spring JIRA.

    Quote Originally Posted by spsaran View Post
    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.
    Ajax requests are meant to be handled as event requests. That's the goal of this ticket:
    https://jira.springframework.org/browse/SWF-1415

  8. #18

    Default

    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).

  9. #19
    Join Date
    May 2013
    Posts
    1

    Default Were you able to find any solution for this?

    Quote Originally Posted by spsaran View Post
    Since it is ServletAware, the ServletTilesRequestContext is initialized and used and its dispatch is,

    Code:
        public void dispatch(String path) throws IOException {
            if (response.isCommitted() || ServletUtil.isForceInclude(request)) {
                include(path);
            } else {
                forward(path);
            }
        }
    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.

    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.

    Were you able to find any solution for this? I am also facing the same problem with spring mvc portlet for liferay

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •