SPR-9016 Add flag to Redirectview to disable expanding URI vars

This commit is contained in:
Rossen Stoyanchev
2012-01-30 18:39:20 -05:00
parent 610fa618aa
commit 21966990c8
3 changed files with 27 additions and 1 deletions

View File

@@ -121,5 +121,17 @@ public class RedirectViewUriTemplateTests {
assertEquals("", this.response.getRedirectedUrl());
}
// SPR-9016
@Test
public void dontApplyUriVariables() throws Exception {
String url = "/test#{'one','abc'}";
RedirectView redirectView = new RedirectView(url, true);
redirectView.setExpandUriTemplateVariables(false);
redirectView.renderMergedOutputModel(new ModelMap(), this.request, this.response);
assertEquals(url, this.response.getRedirectedUrl());
}
}