Fix compile error

Update places that call UriUtils to catch the right exception that is
now raised as a result of using Charet.forName.
This commit is contained in:
Rossen Stoyanchev 2018-02-15 15:59:21 -05:00
parent 4db0d999af
commit 9801afb85d
2 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@
package org.springframework.web.servlet.tags;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
@ -334,7 +334,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
qs.append(UriUtils.encodeQueryParam(param.getValue(), encoding));
}
}
catch (UnsupportedEncodingException ex) {
catch (UnsupportedCharsetException ex) {
throw new JspException(ex);
}
}
@ -363,7 +363,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
try {
uri = uri.replace(template, (value != null ? UriUtils.encodePath(value, encoding) : ""));
}
catch (UnsupportedEncodingException ex) {
catch (UnsupportedCharsetException ex) {
throw new JspException(ex);
}
}
@ -376,7 +376,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
uri = uri.replace(template,
(value != null ? UriUtils.encodePathSegment(param.getValue(), encoding) : ""));
}
catch (UnsupportedEncodingException ex) {
catch (UnsupportedCharsetException ex) {
throw new JspException(ex);
}
}

View File

@ -16,7 +16,7 @@
package org.springframework.web.servlet.tags.form;
import java.io.UnsupportedEncodingException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Map;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@ -625,7 +625,7 @@ public class FormTag extends AbstractHtmlElementTag {
try {
requestUri = UriUtils.encodePath(requestUri, encoding);
}
catch (UnsupportedEncodingException ex) {
catch (UnsupportedCharsetException ex) {
// shouldn't happen - if it does, proceed with requestUri as-is
}
ServletResponse response = this.pageContext.getResponse();