Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 2.3
    • Component/s: Configuration, URL mappings
    • Labels:
      None

      Description

      Background [1]. The two immediate and direct options for simple redirects are:

      • Define the same controller/action/view as the target in the source mapping (not actually an HTTP redirect); or
      • Define a nearly empty controller for the source URL that redirects to the target.

      In URL mappings I want to be able to say:

      "/"(redirect:'/somethingElse')

      This would be more DRY than the first option, and more concise and consolidated than the second.

      [1] http://n4.nabble.com/Specify-redirects-directly-in-UrlMappings-groovy-td1586704.html

        Activity

        Hide
        Peter Ledbrook added a comment -

        As with the redirect() method, this should support both temporary and permanent redirects. So you should be able to do something like

        "/" redirect: "/somethingElse", permanent: true
        
        Show
        Peter Ledbrook added a comment - As with the redirect() method, this should support both temporary and permanent redirects. So you should be able to do something like "/" redirect: "/somethingElse" , permanent: true
        Hide
        cdeszaq added a comment -

        I would love it if I could specify the particular response code used in the redirect, rather than just permanent and non-permanent. Particularly for those applications that are trying to adhere as closely to the HTTP spec and be as RESTful as they can, this sort of power / flexibility is critical.

        Show
        cdeszaq added a comment - I would love it if I could specify the particular response code used in the redirect, rather than just permanent and non-permanent. Particularly for those applications that are trying to adhere as closely to the HTTP spec and be as RESTful as they can, this sort of power / flexibility is critical.
        Hide
        Jeff Scott Brown added a comment -

        Rick,

        That seems like a reasonable feature request but I think it should be a request of its own as that would relate not only to redirects defined in URL mappings, but redirects in general (like those initiated from a controller action, for example). If you like, file a separate JIRA and we can consider that.

        Thanks.

        Show
        Jeff Scott Brown added a comment - Rick, That seems like a reasonable feature request but I think it should be a request of its own as that would relate not only to redirects defined in URL mappings, but redirects in general (like those initiated from a controller action, for example). If you like, file a separate JIRA and we can consider that. Thanks.
        Hide
        cdeszaq added a comment -
        Show
        cdeszaq added a comment - @JeffBrown, done: http://jira.grails.org/browse/GRAILS-10059
        Hide
        Graeme Rocher added a comment -

        Jeff - please move this one up the priority list when you're done with what you're currently working on

        Show
        Graeme Rocher added a comment - Jeff - please move this one up the priority list when you're done with what you're currently working on
        Hide
        Graeme Rocher added a comment -

        Jeff can this issue not be closed? I thought this was added in 2.3 GA

        Show
        Graeme Rocher added a comment - Jeff can this issue not be closed? I thought this was added in 2.3 GA

          People

          • Assignee:
            Jeff Scott Brown
            Reporter:
            Steven Cummings
          • Votes:
            32 Vote for this issue
            Watchers:
            29 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development