Rename charSet to charset

Rename AbstractTemplateViewResolverProperties.setCharSet/getCharSet to
setCharset/getCharset, deprecating the old method.

Fixes gh-1835
This commit is contained in:
Phillip Webb
2014-11-05 16:57:05 -08:00
parent ab7f73f365
commit ba0dd60de9
3 changed files with 24 additions and 8 deletions

View File

@@ -91,7 +91,7 @@ public class FreeMarkerAutoConfiguration {
protected void applyProperties(FreeMarkerConfigurationFactory factory) {
factory.setTemplateLoaderPaths(this.properties.getTemplateLoaderPath());
factory.setDefaultEncoding(this.properties.getCharSet());
factory.setDefaultEncoding(this.properties.getCharset());
Properties settings = new Properties();
settings.putAll(this.properties.getSettings());
factory.setFreemarkerSettings(settings);

View File

@@ -38,7 +38,7 @@ public abstract class AbstractTemplateViewResolverProperties {
private String contentType = "text/html";
private String charSet = "UTF-8";
private String charset = "UTF-8";
private String[] viewNames;
@@ -87,19 +87,35 @@ public abstract class AbstractTemplateViewResolverProperties {
public String getContentType() {
return this.contentType
+ (this.contentType.contains(";charset=") ? "" : ";charset="
+ this.charSet);
+ this.charset);
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
/**
* @deprecated since 1.2.0 in favor of {@link #getCharset()}
*/
@Deprecated
public String getCharSet() {
return this.charSet;
return getCharset();
}
/**
* @deprecated since 1.2.0 in favor of {@link #setCharset(String)}
*/
@Deprecated
public void setCharSet(String charSet) {
this.charSet = charSet;
setCharset(charSet);
}
public String getCharset() {
return this.charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public String getPrefix() {