/** Generates and returns the ZK specific HTML tags including * the headers defined in the specified page, or null if it was * generated before. * * <p>It is shortcut of<br/> *<code>outZkHeader(exec, page, true)+outZkTags(exec, null, null)+outZkHeader(exec, page, false)</code> * * <p>Unlike {@link #outZkTags}, this method cannot be called * in JSP/DSP (since desktop is not available). * * @see #outZkTags */ public static String outHeaderZkTags(Execution exec, Page page) { String s1 = outHeaders(exec, page, true), s2 = outZkTags(exec, null, null), s3 = outHeaders(exec, page, false); return s1 != null ? s2 != null ? s3 != null ? s1 + s2 + s3 : s1 + s2 : s3 != null ? s1 + s3 : s1 : //s2 null s2 != null ? s3 != null ? s2 + s3 : s2 : s3 != null ? s3 : null; //s2 null }
/** Generates and returns the ZK specific HTML tags such as stylesheet * and JavaScript. * If you want to generate HTML HEAD and BODY tags by yourself in * a non-ZUML page (DSP), you can invoke this method at * the location you want (such as inside the HTML HEAD tag). * * @return the string holding the HTML tags, or null if already generated. * @param deviceType the device type. If null, ajax is assumed. */ public static String outZkHtmlTags(String deviceType) { Execution exec = Executions.getCurrent(); if (exec != null) return HtmlPageRenders.outZkTags(exec, null, null); return JspFns.outZkHtmlTags(ServletFns.getCurrentServletContext(), (HttpServletRequest) ServletFns.getCurrentRequest(), (HttpServletResponse) ServletFns.getCurrentResponse(), deviceType); }
/** Generates and returns the ZK specific HTML tags such as stylesheet * and JavaScript. * If you want to generate HTML HEAD and BODY tags by yourself in * a non-ZUML page (e.g., JSP or DSP), you can invoke this method at * the location you want (such as inside the HTML HEAD tag). * * @return the string holding the HTML tags, or null if already generated. * @param deviceType the device type. If null, ajax is assumed. */ public static String outZkHtmlTags(ServletContext ctx, HttpServletRequest request, HttpServletResponse response, String deviceType) { Execution old = Executions.getCurrent(); Execution exec = new ExecutionImpl(ctx, request, response, null, null); ExecutionsCtrl.setCurrent(exec); ((ExecutionCtrl) exec).onActivate(); try { return HtmlPageRenders.outZkTags(exec, WebManager.getWebManager(ctx).getWebApp(), deviceType != null ? deviceType : "ajax"); } finally { ((ExecutionCtrl) exec).onDeactivate(); ExecutionsCtrl.setCurrent(old); } }