Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9016

Provide property in RedirectView to disable treating the redirect URL as a URI template

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.1 GA
    • Fix Version/s: 3.1.1
    • Component/s: Web
    • Labels:
    • Last commented by a User:
      true

      Description

      Previously in Spring 3.0.6, it was entirely valid to return a redirect view with any arbitrary data in the anchor:

      Map<String, String> pojo = new HashMap<String, String>();
      pojo.put("one", "abc");
      String json = (new ObjectMapper()).writeValueAsString(pojo);
      return new RedirectView("/test#" + json, true);

      It seems like Spring 3.1GA attempts to replace '

      {' ABC '}

      ' with the corresponding variable in the model. However, it's perfectly valid for the anchor to json, which wouldn't work, or be expected.

      I don't see any option on the RedirectView to disable applying Uri Template Variables, or it should ignore everything after the '#', or both.

        Attachments

          Activity

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              amuraco Andrew Muraco
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 23 weeks ago