Skip to content

Commit 0a56667

Browse files
committed
Fix SpringUrl Velocity macro URI encoding
Prior to this commit, the springUrl Velocity macro would only prepend the context to the given URL; this means that the ServletHttpResponse.encodeUri method is not called and neither the ResourceUrlProvider. This commit changes this macro to use RequestContext.getContextUrl which prepends the context and encodes the URI. Issue: SPR-14027
1 parent 89cf477 commit 0a56667

File tree

1 file changed

+1
-1
lines changed
  • spring-webmvc/src/main/resources/org/springframework/web/servlet/view/velocity

1 file changed

+1
-1
lines changed

spring-webmvc/src/main/resources/org/springframework/web/servlet/view/velocity/spring.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* Takes a relative URL and makes it absolute from the server root by
5656
* adding the context root for the web application.
5757
*#
58-
#macro( springUrl $relativeUrl )$springMacroRequestContext.getContextPath()${relativeUrl}#end
58+
#macro( springUrl $relativeUrl )$springMacroRequestContext.getContextUrl(${relativeUrl})#end
5959

6060
#**
6161
* springBind

0 commit comments

Comments
 (0)