Velocity Tools
  1. Velocity Tools
  2. VELTOOLS-82

StrutsLinkTool.setForward only sees global-forwards, not local-forwards

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1, 1.2, 1.3, 1.4, 2.x
    • Fix Version/s: 1.4, 2.x
    • Component/s: VelocityStruts
    • Labels:
      None
    • Environment:
      Velocity-Tools 1.3 / Struts 1.3.8

      Description

      Use of $link.setForward('forward-name') will not find forward local forwards for the currently-executing action mapping.

      For instance, if you have the following configuration:

      <global-forwards>
      <forward name="foo" path="/foo.jsp" />
      </global-forwards>

      <action-mappings>
      <action path="/myAction" ...>
      <forward name="foo" path="/bar.jsp" />
      </action>
      </action-mappings>

      Using $link.setForward('foo') will result in "foo.jsp" instead of "bar.jsp". I believe that the latter is more in line with the spirit of Struts' forward hierarchy.

      1. VELTOOLS-82.diff.txt
        1 kB
        Christopher Schultz
      2. VELTOOLS-82doc.diff
        3 kB
        Christopher Schultz

        Activity

        Hide
        Christopher Schultz added a comment -

        Patch to first search local forward definitions.

        Show
        Christopher Schultz added a comment - Patch to first search local forward definitions.
        Hide
        Nathan Bubna added a comment -

        Thanks, Christopher!

        Show
        Nathan Bubna added a comment - Thanks, Christopher!
        Hide
        Christopher Schultz added a comment -

        Don't forget to update the documentation for StrutsLinkTool. I wasn't sure how to do that.

        Show
        Christopher Schultz added a comment - Don't forget to update the documentation for StrutsLinkTool. I wasn't sure how to do that.
        Hide
        Nathan Bubna added a comment -

        Oh yeah. Well, the javadoc for StrutsLinkTool.setForward() is a good start. The xdoc file for that tool (one of the dwindling number of tools that still have xdoc) is in the src at xdocs/struts/StrutsLinkTool.xml (line 103 or so).

        Show
        Nathan Bubna added a comment - Oh yeah. Well, the javadoc for StrutsLinkTool.setForward() is a good start. The xdoc file for that tool (one of the dwindling number of tools that still have xdoc) is in the src at xdocs/struts/StrutsLinkTool.xml (line 103 or so).
        Hide
        Christopher Schultz added a comment -

        Patch for StrutsLinkTool documentation (javadoc + xdoc).

        Show
        Christopher Schultz added a comment - Patch for StrutsLinkTool documentation (javadoc + xdoc).
        Hide
        Nathan Bubna added a comment -

        Thanks again!

        Show
        Nathan Bubna added a comment - Thanks again!
        Hide
        Christopher Schultz added a comment -

        Verified fix.

        Show
        Christopher Schultz added a comment - Verified fix.

          People

          • Assignee:
            Unassigned
            Reporter:
            Christopher Schultz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development