Installation Guide : Installing Ehcache for Specific Technologies
Installing Ehcache for Specific Technologies
Hibernate
1. Perform the same steps as for general-purpose caching (see Installing Ehcache for General-Purpose Caching).
2. Create caches in ehcache.xml.
For more information, see “Using Ehcache with Hibernate” in the Integrations book.
Caching with Java EE Servlet
1. Perform the same steps as for general-purpose caching (see Installing Ehcache for General-Purpose Caching).
2. Configure a cache for your web page in ehcache.xml.
*To cache an entire web page, either use SimplePageCachingFilter or create your own subclass of CachingFilter.
*To cache a jsp:Include or anything callable from a RequestDispatcher, either use SimplePageFragmentCachingFilter or create a subclass of PageFragmentCachingFilter.
3. Configure the web.xml. Declare the filters created above and create filter mapping associating the filter with a URL.
For more information, see the Ehcache Web Cache User Guide.
RESTful and SOAP Caching with the Cache Server
1. Download the ehcache-standalone-server from https://sourceforge.net/projects/ehcache/files/ehcache-server
2. cd to the bin directory.
3. Type startup.sh to start the server with the log in the foreground. By default it will listen on port 8080, will have both RESTful and SOAP web services enabled, and will use a sample Ehcache configuration from the WAR module
4. See “RESTful Code Samples” in the Ehcache Cache Server User Guide. You can use Java or any other programming language with the Cache Server.
JCache Style Caching
Ehcache contains an early draft implementation of JCache contained in the net.sf.ehcache.jcache package. For usage details, see the Integrations book.
Spring, Cocoon, Acegi and Other Frameworks
Usually, with these, you are using Ehcache without even realizing it. The first steps in getting more control over what is happening are:
1. Discover the cache names used by the framework.
2. Create your own ehcache.xml with settings for the caches and place it in the application classpath.
Copyright © 2010-2015 Software AG, Darmstadt, Germany.

Product Logo |   Feedback