/** * Get the HTML MIME type to use * * @param aRequestScope * The request scope. May be <code>null</code>- * @return Never <code>null</code>. */ @Nonnull public static IMimeType getMimeType (@Nullable final IRequestWebScopeWithoutResponse aRequestScope) { // Add the charset to the MIME type return new MimeType (CMimeType.TEXT_HTML).addParameter (CMimeType.PARAMETER_NAME_CHARSET, HCSettings.getHTMLCharset ().name ()); }
@Nonnull public static IHasJSCode windowLocationHref (@Nonnull final ISimpleURL aURL) { return new UnparsedJSCodeProvider ("window.location.href='" + JSMarshaller.javaScriptEscape (aURL.getAsStringWithEncodedParameters (HCSettings.getHTMLCharset ())) + "';"); } }
/** * Create a simple HTML response without JSON structuring * * @param aNode * The node to be rendered. May be <code>null</code>. */ public void htmlSimple (@Nullable final IHCNode aNode) { if (aNode == null) setContentAndCharset ("", HCSettings.getHTMLCharset ()); else setContentAndCharset (HCRenderer.getAsHTMLStringWithoutNamespaces (aNode), HCSettings.getHTMLCharset ()); setMimeType (PhotonHTMLHelper.getMimeType (m_aRequestScope)); }