Add ignorable log file to .gitignore

This commit is contained in:
David Syer
2011-06-05 21:01:37 +00:00
parent 4f96edd901
commit c2e62f098a
6 changed files with 203 additions and 47 deletions

View File

@@ -41,6 +41,7 @@ import org.springframework.web.bind.EscapedErrors;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.util.HtmlUtils;
import org.springframework.web.util.UriTemplate;
import org.springframework.web.util.UrlPathHelper;
import org.springframework.web.util.WebUtils;
@@ -408,6 +409,23 @@ public class RequestContext {
return url;
}
/**
* Return a context-aware URl for the given relative URL with placeholders (named keys with braces <code>{}</code>).
* @param relativeUrl the relative URL part
* @param a map of parameters to insert as placeholders in the url
* @return a URL that points back to the server with an absolute path
* (also URL-encoded accordingly)
*/
public String getContextUrl(String relativeUrl, Map<String,?> params) {
String url = getContextPath() + relativeUrl;
UriTemplate template = new UriTemplate(url);
url = template.expand(params).toASCIIString();
if (this.response != null) {
url = this.response.encodeURL(url);
}
return url;
}
/**
* Return the request URI of the original request, that is, the invoked URL
* without parameters. This is particularly useful as HTML form action target,

View File

@@ -86,7 +86,7 @@
* Takes a relative URL and makes it absolute from the server root by
* adding the context root for the web application.
-->
<#macro url relativeUrl>${springMacroRequestContext.getContextUrl(relativeUrl)}</#macro>
<#macro url relativeUrl extra...><#if extra?? && extra?size!=0>${springMacroRequestContext.getContextUrl(relativeUrl,extra)}<#else>${springMacroRequestContext.getContextUrl(relativeUrl)}</#if></#macro>
<#--
* bind