Wicket
  1. Wicket
  2. WICKET-647 New Wicket Portlet support
  3. WICKET-654

New Wicket Portlet support: translating Wicket relative paths back to fully qualified paths for usage in a portlet context

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-beta2, 1.3.0-beta3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Wicket has the very nice feature of only generating current page relative url paths which is great when working behind mod_proxy.

      But for a portlet, their is no such thing as "current request path", and thus relative paths makes no sense here.
      Actually, the WicketPortlet solution will rewrite all wicket urls as PortletURL with the targetted wicket url as embedded parameter.

      So, when running in a portlet context (RenderContext.isEmbedded()), the Request.getRelativePathPrefixToContextRoot() and .getRelativePathPrefixToWicketHandler() need to adapted to return a prefix which will make the generated wicket url fully qualified again against the base/domain url.
      This might seem like a problem for environments behind mod_proxy (and it might), but when you run a portal this is a common/known issue.

      The changes I'll commit against this issue are only effective when RenderContext.isEmbedded() == true, so this will have no effect in the normal case.

        Activity

        Martin Grigorov made changes -
        Component/s wicket-portlet [ 12311803 ]
        Ate Douma made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Ate Douma added a comment -

        It works

        Show
        Ate Douma added a comment - It works
        ate committed 573219 (1 file)
        Reviews: none

        WICKET-654: New Wicket Portlet support: translating Wicket relative paths back to fully qualified paths for usage in a portlet context
        See: https://issues.apache.org/jira/browse/WICKET-654
        - adding support for src and href AttributeModifier usage (e.g. as used in the staticpages examples)
          Note: This can *only* work for initial static page access. If the rendered page itself contains wicket relative urls, those won't be translated!

        Ate Douma made changes -
        Field Original Value New Value
        Affects Version/s 1.3.0-beta3 [ 12312533 ]
        Hide
        Ate Douma added a comment -

        Switching to a new 1.3.0-beta3-portlet-support branch

        Show
        Ate Douma added a comment - Switching to a new 1.3.0-beta3-portlet-support branch
        Hide
        Ate Douma added a comment -

        Initial implementation committed, probably needing further improvement, so I'll leave this issue open for now.

        Show
        Ate Douma added a comment - Initial implementation committed, probably needing further improvement, so I'll leave this issue open for now.
        Ate Douma created issue -

          People

          • Assignee:
            Ate Douma
            Reporter:
            Ate Douma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development