Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-251

RequestUtils.absoluteURL() no longer using context information from the request

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 Beta 3
    • Fix Version/s: 1.0.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: All
    • Bugzilla Id:
      2135

      Description

      I think the behavior of RequestUtils.absoluteURL(request, path) was
      unintentionally changed between Beta 1 and Beta 2+. It no longer includes the
      requests context path in its output.

      I think line 138 of RequestUtils should read:
      return (new URL(serverURL(request), request.getContextPath() + path));

      As an aside, the following searches indicate struts no longer uses this method.
      However, I think the method is quite useful on its own and probably shouldn't
      be removed.

      Searching for: absoluteURL
      src\share\org\apache\struts\taglib\bean\IncludeTag.java(304): href =
      RequestUtils.absoluteURL(request, forward.getPath());
      src\share\org\apache\struts\taglib\bean\IncludeTag.java(311): href =
      RequestUtils.absoluteURL(request, this.page);
      src\share\org\apache\struts\taglib\html\LinkTag.java(444): href =
      RequestUtils.absoluteURL(request, forward.getPath());
      src\share\org\apache\struts\taglib\html\LinkTag.java(451): href =
      RequestUtils.absoluteURL(request, page);
      src\share\org\apache\struts\taglib\logic\RedirectTag.java(361): href =
      RequestUtils.absoluteURL(request, forward.getPath());
      src\share\org\apache\struts\taglib\logic\RedirectTag.java(368): href =
      RequestUtils.absoluteURL(request, page);
      src\share\org\apache\struts\util\RequestUtils.java(127): public static String
      absoluteURL(HttpServletRequest request, String path) {
      Found 7 occurrence(s) in 4 file(s)

      Searching C:\tools\jakarta-struts-1.0-b2-src\ for: absoluteURL
      src\share\org\apache\struts\util\RequestUtils.java(135): public static URL
      absoluteURL(HttpServletRequest request, String path)
      Found 1 occurrence(s) in 1 file(s)

      Searching C:\tools\jakarta-struts-1.0-b3-src\ for: absoluteURL
      src\share\org\apache\struts\util\RequestUtils.java(135): public static URL
      absoluteURL(HttpServletRequest request, String path)
      Found 1 occurrence(s) in 1 file(s)

        Attachments

          Activity

            People

            • Assignee:
              craigmcc Craig R. McClanahan
              Reporter:
              levicook@hotmail.com Levi Cook
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: