Polishing

This commit is contained in:
Juergen Hoeller 2018-09-17 15:00:33 +02:00
parent 88ab911cf1
commit c385a1de83
2 changed files with 6 additions and 5 deletions

View File

@ -166,7 +166,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
/** /**
* Sets the value of the URL. * Set the value of the URL.
*/ */
public void setValue(String value) { public void setValue(String value) {
if (value.contains(URL_TYPE_ABSOLUTE)) { if (value.contains(URL_TYPE_ABSOLUTE)) {
@ -184,7 +184,8 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
} }
/** /**
* Set the context path for the URL. Defaults to the current context * Set the context path for the URL.
* Defaults to the current context.
*/ */
public void setContext(String context) { public void setContext(String context) {
if (context.startsWith("/")) { if (context.startsWith("/")) {
@ -375,7 +376,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
String value = param.getValue(); String value = param.getValue();
try { try {
uri = StringUtils.replace(uri, template, uri = StringUtils.replace(uri, template,
(value != null ? UriUtils.encodePathSegment(param.getValue(), encoding) : "")); (value != null ? UriUtils.encodePathSegment(value, encoding) : ""));
} }
catch (UnsupportedCharsetException ex) { catch (UnsupportedCharsetException ex) {
throw new JspException(ex); throw new JspException(ex);

View File

@ -28,8 +28,8 @@ import org.springframework.web.util.UriComponentsBuilder;
/** /**
* Container for the base URL of a SockJS endpoint with additional helper methods * Container for the base URL of a SockJS endpoint with additional helper methods
* to derive related SockJS URLs as the {@link #getInfoUrl() info} URL and * to derive related SockJS URLs: specifically, the {@link #getInfoUrl() info}
* {@link #getTransportUrl(TransportType) transport} URLs. * and {@link #getTransportUrl(TransportType) transport} URLs.
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 4.1 * @since 4.1