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

Must use contextRelative to forward to Actions in Default module

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.4
    • 1.2 Family
    • Core
    • None
    • Operating System: other
      Platform: All
    • 32134

    Description

      The new forward configuration encourages using the "module" element instead of
      the deprecated "contextRelative" element. However, it fails in this case
      where we want to switch to the default module:

      <forward name="HomePage" path="/HomePage.do" module="/" redirect="true" />

      The calculated URL ends up //HomePage.do instead of /HomePage.do (double '/').

      The workaround is to configure the "old" way:

      <forward name="HomePage" path="/HomePage.do" contextRelative="true"
      redirect="true" />

      My proposed fix is to change the "forwardURL" method in RequestUtils like this:

      if(forward.getModule() != null) {
      prefix = forward.getModule();
      if ("/".equals(prefix)

      { // new line prefix = ""; // new line }

      // new line
      }

      This works for my situation, but should be verified by someone who knows the
      entire code base better.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dhscn06@cstone.dhs.state.il.us Jeff Butler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: