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

Unable to Redirect within framework - Add RedirectAction?

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.1 Beta 2
    • Fix Version/s: None
    • Component/s: Extras
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • Bugzilla Id:
      16173

      Description

      I am attempting to send a redirect using the Struts v1.1b2 library. I
      attempted using the "redirect" and "contextRelative" attributes of the
      <forward> element within an action. These did not work. I noticed that in the
      source code for the build, the context path is ALWAYS being appended, even when
      the redirect attribute is set to true, and even when I specify a fully
      qualified URL. I tried redirecting to "/marvel/test.html" which is a separate
      web application sharing the webserver. Then I tried "http://www.yahoo.com".
      Neither seemed to work.

      What I really wanted was an action which would be analagous to the
      ForwardAction, but sends a redirect instead of a forward. Such an action does
      not exist. So, I took the ForwardAction, copied it, and changed it to send a
      redirect instead of a forward. Now it works just the way I wanted it to. See
      the tag below.

      <action path="/marvelJump"
      type="xxx.share.web.RedirectAction"
      parameter="/marvel/f?p=106:1">
      </action>

      I suggest including this RedirectAction in the next Struts release. Let me
      provide the business case. We have multiple applications running on multiple
      application servers, but sharing one web server. These applications perform
      different tasks, but we need to link between them to provide users access to
      the full set of functionality. We use ACL security to ensure only authorized
      users can even enter the other applications. This means I must wrap any simple
      links with a web resource (aka an action) to enforce this security. The
      RedirectAction above is perfect for doing this.

      Please feel free to contact me for further information. Thanks for your time,
      and thanks for all of your hard work on the Struts framework.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              parsetdx@hotmail.com Josh Parker
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: