/** Cleans up the info carried from onPiggyback to the current thread. * <p>Note: {@link #carryOver} and {@link #cleanup} must be * called in the same thread. */ public void cleanup() { ((ExecutionCtrl) _exec).onDeactivate(); ExecutionsCtrl.setCurrent(null); if (_locale != null) Locales.setThreadLocal(null); if (_timeZone != null) TimeZones.setThreadLocal(null); } }
/** De-reactivated exec. Work with {@link #doReactivate}. */ private static void doDereactivate(Execution curExec, UiVisualizer olduv) { if (olduv == null) throw new IllegalArgumentException("null"); final ExecutionCtrl curCtrl = (ExecutionCtrl) curExec; final Execution oldexec = olduv.getExecution(); try { final Desktop desktop = curExec.getDesktop(); // if (log.finerable()) log.finer("Deactivating "+desktop); try { curCtrl.onDeactivate(); } catch (Throwable ex) { log.warn("Failed to deactive", ex); } final DesktopCtrl desktopCtrl = (DesktopCtrl) desktop; desktopCtrl.setVisualizer(olduv); desktopCtrl.setExecution(oldexec); } finally { ExecutionsCtrl.setCurrent(oldexec); curCtrl.setCurrentPage(null); } }
((ExecutionCtrl) exec).onDeactivate(); ExecutionsCtrl.setCurrent(olde);
_acted = false; try { ((ExecutionCtrl) exec).onDeactivate(); } catch (Throwable ex) { log.warn("Ignored deactivate failure", ex);
execCtrl.onDeactivate(); } catch (Throwable ex) { log.warn("Failed to deactive", ex);
/** Returns HTML tags to include JavaScript files of the specified * device for the current application (never null). * @since 5.0.0 */ public static final String outDeviceJavaScripts(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.outLangJavaScripts(exec, WebManager.getWebManager(ctx).getWebApp(), deviceType != null ? deviceType : "ajax"); } finally { ((ExecutionCtrl) exec).onDeactivate(); ExecutionsCtrl.setCurrent(old); } }
/** Returns HTML tags to include style sheets of the specified device * for the current application (never null). * * <p>This method is used for JSP pages. * @param deviceType the device type. If null, ajax is assumed. */ public static final String outDeviceStyleSheets(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.outLangStyleSheets(exec, WebManager.getWebManager(ctx).getWebApp(), deviceType != null ? deviceType : "ajax"); } finally { ((ExecutionCtrl) exec).onDeactivate(); ExecutionsCtrl.setCurrent(old); } }
/** 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); } }
_acted = false; try { ((ExecutionCtrl) exec).onDeactivate(); } catch (Throwable ex) { log.warn("Ignored deactivate failure", ex);