/** * Set-up response with appropriate content type, locale and encoding. The locale is set equal * to the session's locale. The content type header contains information about the markup type * (@see #getMarkupType()) and the encoding. The response (and request) encoding is determined * by an application setting (@see ApplicationSettings#getResponseRequestEncoding()). If null, * no xml decl will be written. * * @param response * The WebResponse object */ protected void configureResponse(final WebResponse response) { // Users may subclass setHeader() to set there own headers setHeaders(response); // The response encoding is an application setting final String encoding = getApplication().getRequestCycleSettings() .getResponseRequestEncoding(); final boolean validEncoding = (Strings.isEmpty(encoding) == false); final String contentType; if (validEncoding) { contentType = getMarkupType().getMimeType() + "; charset=" + encoding; } else { contentType = getMarkupType().getMimeType(); } response.setContentType(contentType); }
/** * Set-up response with appropriate content type, locale and encoding. The locale is set equal * to the session's locale. The content type header contains information about the markup type * (@see #getMarkupType()) and the encoding. The response (and request) encoding is determined * by an application setting (@see ApplicationSettings#getResponseRequestEncoding()). If null, * no xml decl will be written. * * @param response * The WebResponse object */ protected void configureResponse(final WebResponse response) { // Users may subclass setHeader() to set there own headers setHeaders(response); // The response encoding is an application setting final String encoding = getApplication().getRequestCycleSettings() .getResponseRequestEncoding(); final boolean validEncoding = (Strings.isEmpty(encoding) == false); final String contentType; if (validEncoding) { contentType = getMarkupType().getMimeType() + "; charset=" + encoding; } else { contentType = getMarkupType().getMimeType(); } response.setContentType(contentType); }
if (insert || MarkupType.XML_MIME.equalsIgnoreCase(page.getMarkupType().getMimeType()))
if (insert || MarkupType.XML_MIME.equalsIgnoreCase(page.getMarkupType().getMimeType()))