private ContentType getTemplateSpecificContentType(final Template template) { Object contentTypeAttr = template.getCustomAttribute("content_type"); if (contentTypeAttr != null) { // Converted with toString() for backward compatibility. return new ContentType(contentTypeAttr.toString()); } String outputFormatMimeType = template.getOutputFormat().getMimeType(); if (outputFormatMimeType != null) { if (responseCharacterEncoding == ResponseCharacterEncoding.LEGACY) { // In legacy mode we won't call serlvetResponse.setCharacterEncoding(...), so: return new ContentType(outputFormatMimeType + "; charset=" + getTemplateSpecificOutputEncoding(template), true); } else { return new ContentType(outputFormatMimeType, false); } } return null; }
contentType.httpHeaderValue + "; charset=" + getTemplateSpecificOutputEncoding(template)); } else { response.setContentType(contentType.httpHeaderValue); response.setCharacterEncoding(getTemplateSpecificOutputEncoding(template));
private ContentType getTemplateSpecificContentType(final Template template) { Object contentTypeAttr = template.getCustomAttribute("content_type"); if (contentTypeAttr != null) { // Converted with toString() for backward compatibility. return new ContentType(contentTypeAttr.toString()); } String outputFormatMimeType = template.getOutputFormat().getMimeType(); if (outputFormatMimeType != null) { if (responseCharacterEncoding == ResponseCharacterEncoding.LEGACY) { // In legacy mode we won't call serlvetResponse.setCharacterEncoding(...), so: return new ContentType(outputFormatMimeType + "; charset=" + getTemplateSpecificOutputEncoding(template), true); } else { return new ContentType(outputFormatMimeType, false); } } return null; }
private ContentType getTemplateSpecificContentType(final Template template) { Object contentTypeAttr = template.getCustomAttribute("content_type"); if (contentTypeAttr != null) { // Converted with toString() for backward compatibility. return new ContentType(contentTypeAttr.toString()); } String outputFormatMimeType = template.getOutputFormat().getMimeType(); if (outputFormatMimeType != null) { if (responseCharacterEncoding == ResponseCharacterEncoding.LEGACY) { // In legacy mode we won't call serlvetResponse.setCharacterEncoding(...), so: return new ContentType(outputFormatMimeType + "; charset=" + getTemplateSpecificOutputEncoding(template), true); } else { return new ContentType(outputFormatMimeType, false); } } return null; }
contentType.httpHeaderValue + "; charset=" + getTemplateSpecificOutputEncoding(template)); } else { response.setContentType(contentType.httpHeaderValue); response.setCharacterEncoding(getTemplateSpecificOutputEncoding(template));
contentType.httpHeaderValue + "; charset=" + getTemplateSpecificOutputEncoding(template)); } else { response.setContentType(contentType.httpHeaderValue); response.setCharacterEncoding(getTemplateSpecificOutputEncoding(template));