|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.conf.ServletUtil
public class ServletUtil
Configuration class that uses ServletContext to locate resources. This class is intended for use in J2EE servlet containers. It is compatible with containers following servlet specification version 2.2 and newer (e.g. Tomcat can be used starting from version 3).
ServletConfiguration resolves configuration file locations relative to the web
application "WEB-INF" directory, and does not require them to be in the CLASSPATH
(though CLASSPATH locations such as "/WEB-INF/classes" and "/WEB-INF/lib/some.jar" are
supported as well). By default search for cayenne.xml is done in /WEB-INF/ folder. To
specify an arbitrary context path in the web application (e.g. "/WEB-INF/cayenne"), use
cayenne.configuration.path
context parameters in web.xml
.
Field Summary | |
---|---|
static String |
CONFIGURATION_PATH_KEY
A name of the web application initialization parameter used to specify extra paths where Cayenne XML files might be located. |
static String |
DATA_CONTEXT_KEY
Used by BasicServletConfiguration as a session attribute for DataContext. |
Constructor Summary | |
---|---|
ServletUtil()
|
Method Summary | |
---|---|
protected static ResourceLocator |
createLocator(javax.servlet.ServletContext context)
A helper method to create default ResourceLocator. |
static DataContext |
getSessionContext(javax.servlet.http.HttpSession session)
Returns default Cayenne DataContext associated with the HttpSession, creating it on the fly and storing in the session if needed. |
static Configuration |
initializeSharedConfiguration(javax.servlet.ServletContext context)
Creates a new ServletConfiguration and sets is as a Configuration signleton. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONFIGURATION_PATH_KEY
public static final String DATA_CONTEXT_KEY
Constructor Detail |
---|
public ServletUtil()
Method Detail |
---|
public static Configuration initializeSharedConfiguration(javax.servlet.ServletContext context)
protected static ResourceLocator createLocator(javax.servlet.ServletContext context)
public static DataContext getSessionContext(javax.servlet.http.HttpSession session)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |