org.apache.cayenne.configuration.web

## Class WebUtil

- java.lang.Object
- - org.apache.cayenne.configuration.web.WebUtil

-     public class WebUtil
      extends Object

  A helper class to retrieve and store `CayenneRuntime` in the `ServletContext`. All Cayenne web configuration objects, such as `CayenneFilter` and `ROPHessianServlet`, are using this class to access runtime.
  Since:
    3.1

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WebUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CayenneRuntime` | `getCayenneRuntime(javax.servlet.ServletContext context)` Retrieves CayenneRuntime previously stored in provided context via `setCayenneRuntime(ServletContext, CayenneRuntime)`.
    `static void` | `setCayenneRuntime(javax.servlet.ServletContext context, CayenneRuntime runtime)` Stores `CayenneRuntime` in the servlet context.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WebUtil

          public WebUtil()

  - ### Method Detail

    - #### getCayenneRuntime

          public static CayenneRuntime getCayenneRuntime(javax.servlet.ServletContext context)

      Retrieves CayenneRuntime previously stored in provided context via `setCayenneRuntime(ServletContext, CayenneRuntime)`. May return null if no runtime was stored.

    - #### setCayenneRuntime

          public static void setCayenneRuntime(javax.servlet.ServletContext context,
                                               CayenneRuntime runtime)

      Stores `CayenneRuntime` in the servlet context. It can be later retrieve via `getCayenneRuntime(ServletContext)`.

Copyright © 2001–2017 Apache Cayenne. All rights reserved.