Consistent support for Charset/StandardCharsets in UriUtils etc

Issue: SPR-15613
This commit is contained in:
Juergen Hoeller
2017-06-12 15:51:45 +02:00
parent 14161d1dbf
commit 3ae84d6dd8
15 changed files with 244 additions and 171 deletions

View File

@@ -16,7 +16,6 @@
package org.springframework.web.reactive.result.view;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
@@ -260,14 +259,8 @@ public class RedirectView extends AbstractUrlBasedView {
}
private String encodeUriVariable(String text) {
try {
// Strict encoding of all reserved URI characters
return UriUtils.encode(text, StandardCharsets.UTF_8.name());
}
catch (UnsupportedEncodingException ex) {
// Should never happen...
throw new IllegalStateException(ex);
}
// Strict encoding of all reserved URI characters
return UriUtils.encode(text, StandardCharsets.UTF_8);
}
/**