Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springUrl Velocity macro should encode the given URI using the response [SPR-14027] #18599

spring-issuemaster opened this issue Mar 8, 2016 · 0 comments


Copy link

@spring-issuemaster spring-issuemaster commented Mar 8, 2016

Brian Clozel opened SPR-14027 and commented

Spring provides ways to rewrite resource URLs using the ResourceUrlEncodingFilter and ResourceUrlProvider. By using the HttpServletResponse.encodeUrl method, supported template engines can trigger that mechanism to rewrite the resource URL.

The dedicated Velocity macros provided by Spring, springUrl only prepends the URL with the context, instead of calling the actual method RequestContext.getContextUrl; this is actually done for the Freemarker equivalent.

In the meantime, developers who want this feature should override Spring's macro or declare their own like this:

#macro( springResourceUrl $relativeUrl )$springMacroRequestContext.getContextUrl(${relativeUrl})#end

Affects: 4.2.5

Reference URL:

Issue Links:

  • #9845 Binding in Velocity templates using EL accessors ([, ]) for collections produces non xhtml strict compliant output

Referenced from: commits 0a56667, f76b38c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.