01: package com.opensymphony.sitemesh.webapp;
02:
03: import com.opensymphony.module.sitemesh.util.Container;
04:
05: /**
06: * Provides details of which tweaks should be used in SiteMesh - necessary because containers behave subtly different.
07: *
08: * @author Joe Walnes
09: * @since SiteMesh 3
10: */
11: public class ContainerTweaks {
12:
13: // TODO: Externalize these into a config file (optional of course!), allowing users to change them at runtime if needed.
14:
15: private final int container = Container.get();
16:
17: public boolean shouldAutoCreateSession() {
18: return container == Container.TOMCAT;
19: }
20:
21: public boolean shouldLogUnhandledExceptions() {
22: return container == Container.TOMCAT;
23: }
24:
25: public boolean shouldIgnoreIllegalStateExceptionOnErrorPage() {
26: return container == Container.WEBLOGIC;
27: }
28: }
|