X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Futil%2FSimpleApp.java;h=9f0e32037f7c9c78c3080ba8c97325f4a1d0a1ec;hb=86db10fcb2299ebf71d5599a80dc54444b26f893;hp=be764e975b10ca8bb9f978ae6b2e715e15ba9079;hpb=ba85380c1db977b0d9ea3182d1383956a8b80679;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/util/SimpleApp.java b/org.argeo.cms/src/org/argeo/cms/util/SimpleApp.java index be764e975..9f0e32037 100644 --- a/org.argeo.cms/src/org/argeo/cms/util/SimpleApp.java +++ b/org.argeo.cms/src/org/argeo/cms/util/SimpleApp.java @@ -19,7 +19,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.cms.CmsConstants; import org.argeo.cms.CmsException; -import org.argeo.cms.CmsSession; import org.argeo.cms.CmsUiProvider; import org.argeo.cms.LifeCycleUiProvider; import org.argeo.jcr.JcrUtils; @@ -60,6 +59,8 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration, public void configure(Application application) { try { application.setOperationMode(OperationMode.SWT_COMPATIBILITY); + // application.setOperationMode(OperationMode.JEE_COMPATIBILITY); + application.setExceptionHandler(new CmsExceptionHandler()); // loading animated gif @@ -97,11 +98,13 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration, } // page title - if (!properties.containsKey(WebClient.PAGE_TITLE)) - properties.put( - WebClient.PAGE_TITLE, - Character.toUpperCase(page.charAt(0)) - + page.substring(1)); + if (!properties.containsKey(WebClient.PAGE_TITLE)) { + if (page.length() > 0) + properties.put( + WebClient.PAGE_TITLE, + Character.toUpperCase(page.charAt(0)) + + page.substring(1)); + } // default body HTML if (!properties.containsKey(WebClient.BODY_HTML)) @@ -233,7 +236,7 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration, @Override public void handleException(Throwable throwable) { - CmsSession.current.get().exception(throwable); + CmsUtils.getCmsView().exception(throwable); } } @@ -259,7 +262,7 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration, // entryPoint.setState(""); entryPoint.setHeader(header); entryPoint.setHeaderHeight(headerHeight); - CmsSession.current.set(entryPoint); + // CmsSession.current.set(entryPoint); return entryPoint; }