/** * Output 404 with appropriate message. * @param resp the http response. * @param message the message to include on the page. * @throws IOException on any error. */ public static void notFound(HttpServletResponse resp, String message) throws IOException { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1(message). _(); }
/** * Output 404 with appropriate message. * @param resp the http response. * @param message the message to include on the page. * @throws IOException on any error. */ public static void notFound(HttpServletResponse resp, String message) throws IOException { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1(message). _(); }
/** * Output 404 with appropriate message. * @param resp the http response. * @param message the message to include on the page. * @throws IOException on any error. */ public static void notFound(HttpServletResponse resp, String message) throws IOException { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1(message). _(); }
/** * Warn the user that the link may not be safe! * @param resp the http response * @param link the link to point to * @param user the user that owns the link. * @throws IOException on any error. */ private static void warnUserPage(HttpServletResponse resp, String link, String user, ApplicationId id) throws IOException { //Set the cookie when we warn which overrides the query parameter //This is so that if a user passes in the approved query parameter without //having first visited this page then this page will still be displayed resp.addCookie(makeCheckCookie(id, false)); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1("WARNING: The following page may not be safe!"). h3(). _("click ").a(link, "here"). _(" to continue to an Application Master web interface owned by ", user). _(). _(); }
/** * Warn the user that the link may not be safe! * @param resp the http response * @param link the link to point to * @param user the user that owns the link. * @throws IOException on any error. */ private static void warnUserPage(HttpServletResponse resp, String link, String user, ApplicationId id) throws IOException { //Set the cookie when we warn which overrides the query parameter //This is so that if a user passes in the approved query parameter without //having first visited this page then this page will still be displayed resp.addCookie(makeCheckCookie(id, false)); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1("WARNING: The following page may not be safe!"). h3(). _("click ").a(link, "here"). _(" to continue to an Application Master web interface owned by ", user). _(). _(); }
@Override protected void render(Page.HTML<_> html) { set(JQueryUI.ACCORDION_ID, "msg"); String title = "Sorry, got error "+ status(); html. title(title). link(root_url("static","yarn.css")). _(JQueryUI.class). // an embedded sub-view style("#msg { margin: 1em auto; width: 88%; }", "#msg h1 { padding: 0.2em 1.5em; font: bold 1.3em serif; }"). div("#msg"). h1(title). div(). _("Please consult"). a("http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "RFC 2616")._(" for meanings of the error code.")._(). h1("Error Details"). pre(). _(errorDetails())._()._()._(); }
@Override protected void render(Page.HTML<_> html) { set(JQueryUI.ACCORDION_ID, "msg"); String title = "Sorry, got error "+ status(); html. title(title). link(root_url("static","yarn.css")). _(JQueryUI.class). // an embedded sub-view style("#msg { margin: 1em auto; width: 88%; }", "#msg h1 { padding: 0.2em 1.5em; font: bold 1.3em serif; }"). div("#msg"). h1(title). div(). _("Please consult"). a("http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "RFC 2616")._(" for meanings of the error code.")._(). h1("Error Details"). pre(). _(errorDetails())._()._()._(); }
/** * Warn the user that the link may not be safe! * @param resp the http response * @param link the link to point to * @param user the user that owns the link. * @throws IOException on any error. */ private static void warnUserPage(HttpServletResponse resp, String link, String user, ApplicationId id) throws IOException { //Set the cookie when we warn which overrides the query parameter //This is so that if a user passes in the approved query parameter without //having first visited this page then this page will still be displayed resp.addCookie(makeCheckCookie(id, false)); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1("WARNING: The following page may not be safe!"). h3(). _("click ").a(link, "here"). _(" to continue to an Application Master web interface owned by ", user). _(). _(); }
@Override protected void render(Page.HTML<_> html) { html. // produces valid html 4.01 strict title($("title")). p("#hello-for-css"). _($("title"))._()._(); } }
@Override public void render(Page.HTML<_> html) { html. title("test"). p("#testid")._("test note")._()._(); } }
@Override public void render(Page.HTML<_> html) { html. title($("title")). h1($("title"))._(); } }
@Override public void render(Page.HTML<_> html) { html. title("test"). p("#testid")._("test note")._()._(); } }
@Override public void render(Page.HTML<_> html) { html. title("short test"). _(ShortBlock.class); } }
@Override protected void render(Page.HTML<_> html) { html. // produces valid html 4.01 strict title($("title")). p("#hello-for-css"). _($("title"))._()._(); } }
@Override public void render(Page.HTML<_> html) { html. title("short test"). _(ShortBlock.class); } }
@Override public void render(Page.HTML<_> html) { html. title("My App"). p("#content_id_for_css_styling"). _("You can have", $("anything"))._()._(); // Note, there is no _(); (to parent element) method at root level. // and IDE provides instant feedback on what level you're on in // the auto-completion drop-downs. } }
@Override public void render(Page.HTML<_> html) { html. title($("title")). h1($("title"))._(); } }
@Override public void render(Page.HTML<_> html) { html. body(). div(). _(Sub1.class)._(). div(). i("inline text"). _(Sub2.class)._()._()._(); } }
@Override public void render(Page.HTML<_> html) { html. title("My App"). p("#content_id_for_css_styling"). _("You can have", $("anything"))._()._(); // Note, there is no _(); (to parent element) method at root level. // and IDE provides instant feedback on what level you're on in // the auto-completion drop-downs. } }
@Override public void render(Page.HTML<_> html) { html. body(). div(). _(Sub1.class)._(). div(). i("inline text"). _(Sub2.class)._()._()._(); } }