\r
dispatcher.include(request, response);\r
\r
- if (isLifeRay) {\r
- /*\r
- * Temporary support to heartbeat Liferay session when using\r
- * Vaadin based portlet. We hit an extra xhr to liferay\r
- * servlet to extend the session lifetime after each Vaadin\r
- * request. This hack can be removed when supporting portlet\r
- * 2.0 and resourceRequests.\r
- * \r
- * TODO make this configurable, this is not necessary with\r
- * some custom session configurations.\r
- */\r
- OutputStream out = response.getPortletOutputStream();\r
-\r
- String lifeRaySessionHearbeatHack = ("<script type=\"text/javascript\">"\r
- + "if(!vaadin.postRequestHooks) {"\r
- + " vaadin.postRequestHooks = {};"\r
- + "}"\r
- + "vaadin.postRequestHooks.liferaySessionHeartBeat = function() {"\r
- + " if (Liferay && Liferay.Session) {"\r
- + " Liferay.Session.extend();"\r
- + " }"\r
- + "};" + "</script>");\r
- out.write(lifeRaySessionHearbeatHack.getBytes());\r
- }\r
-\r
/*\r
* Make sure portal default Vaadin theme is included exactly\r
* once in DOM.\r
\r
// Using portal-wide theme\r
String loadDefaultTheme = ("<script type=\"text/javascript\">\n"\r
+ + "if(!vaadin) { var vaadin = {} } \n"\r
+ + "if(!vaadin.vaadinConfigurations) { vaadin.vaadinConfigurations = {} } \n"\r
+ + "if(!vaadin.themesLoaded) { vaadin.themesLoaded = {} } \n"\r
+ "if(!vaadin.themesLoaded['"\r
+ portalTheme\r
+ "']) {\n"\r
out.write(loadDefaultTheme.getBytes());\r
}\r
\r
+ if (isLifeRay) {\r
+ /*\r
+ * Temporary support to heartbeat Liferay session when using\r
+ * Vaadin based portlet. We hit an extra xhr to liferay\r
+ * servlet to extend the session lifetime after each Vaadin\r
+ * request. This hack can be removed when supporting portlet\r
+ * 2.0 and resourceRequests.\r
+ * \r
+ * TODO make this configurable, this is not necessary with\r
+ * some custom session configurations.\r
+ */\r
+ OutputStream out = response.getPortletOutputStream();\r
+\r
+ String lifeRaySessionHearbeatHack = ("<script type=\"text/javascript\">"\r
+ + "if(!vaadin.postRequestHooks) {"\r
+ + " vaadin.postRequestHooks = {};"\r
+ + "}"\r
+ + "vaadin.postRequestHooks.liferaySessionHeartBeat = function() {"\r
+ + " if (Liferay && Liferay.Session) {"\r
+ + " Liferay.Session.extend();"\r
+ + " }"\r
+ + "};" + "</script>");\r
+ out.write(lifeRaySessionHearbeatHack.getBytes());\r
+ }\r
+\r
} catch (PortletException e) {\r
PrintWriter out = response.getWriter();\r
out.print("<h1>Servlet include failed!</h1>");\r