Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-540

ServletWebRequest.getContextPath() ignores ContextPath as set by user (accesses HttpServletRequest directly)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.5
    • Fix Version/s: 1.2.7
    • Component/s: wicket
    • Labels:
      None

      Description

      I'm running Wicket behind a front-end proxy. To fix certain issues with this I have set the ContextPath value in my application settings (and/or in Web.xml), However, when using functions that attempt to get at the context path (e.g. continueToOriginalDestination()) the app does not respect my setting.

      This is because in ServletWebRequest, getContextPath() directly accesses HttpServletRequest without checking the application settings.

      I believe it should first check the application settings, and only if ContextPath is /not/ set, then access the HttpServletRequest.

        Activity

        Hide
        almaw Alastair Maw added a comment -

        Hmmm, this was actually a pretty trivial fix. It'll be in 1.2.7.

        Show
        almaw Alastair Maw added a comment - Hmmm, this was actually a pretty trivial fix. It'll be in 1.2.7.
        Hide
        almaw Alastair Maw added a comment -

        I'm afraid we're unlikely to fix this in the 1.2.x branch, due to limited time and pressure to get 1.3 final out. If you can provide a patch, I'll review and commit it, however.

        The 1.3.x branch uses relative URLs, which overcome this issue (you don't need to set a contextpath setting at all).

        Show
        almaw Alastair Maw added a comment - I'm afraid we're unlikely to fix this in the 1.2.x branch, due to limited time and pressure to get 1.3 final out. If you can provide a patch, I'll review and commit it, however. The 1.3.x branch uses relative URLs, which overcome this issue (you don't need to set a contextpath setting at all).

          People

          • Assignee:
            almaw Alastair Maw
            Reporter:
            fattymelt Seth Green
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development