Getting started http://blog.csdn.net/mgoann/archive/2009/04/16/4083962.aspx
Ehcache getting started
Introduction
Ehcache can be used directly. It can also be used in combination with the hibernate object/link framework. You can also perform servlet caching.
General Cache
· Ensure that JDK supports your existing ehcache versions. ehcache supports jdk1.4, 1.5, and 1.6.
· Add the ehcache jar package to your classpath environment variable.
· The class libraries on which ehcache depends are added to your classpath environment variables. Different Versions of ehcache depend on different class libraries. Note that the ehcache versions and related dependent class libraries are not described here. For details, refer
Http://ehcache.sourceforge.net/documentation/dependencies.html
· Configure the ehcache. xml configuration file and add it to classpath.
· Configure logging to the appropriate level.
Hibernate
· Refer to the general cache procedure.
· Create a cache in ehcache. xml.
Java EE ServletCache
· Refer to general cache steps.
· Configure cache for your web page in ehcache. xml.
· To Cache all pages, you can use simplepagecachingfilter provided by ehcache or write a subclass to inherit the cachingfilter.
· To Cache a specific JSP page (including the page returned by requestdispatcher), you can use simplepagefragmentcachingfilter provided by ehcache or write a subclass to inherit pagefragmentcachingfilter.
· Configure web. xml. Here it is relatively simple, Just configure the filter you used in the last two steps to the Web. XML, so that the request can access the pages in the cache when the request arrives, so as to provide the corresponding page speed.
RestfulAndSoapCache
From http://sourceforge.net/project/showfiles.php? Group_id = 93232 download cache server.
· Use the CD command to switch to the bin directory.
· Type startup. Sh to start the service.
By default, port 8080 is used, and both restful and soap Web servers use this port. Pay attention to port occupation.
· Cache Server can be used at this time. You can use any other language of Java. For more information, see
Http://ehcache.sourceforge.net/documentation/cache_server.html.
Jcache style caching
In the net. Sh. ehcache. jcache package, ehcache has a rough Implementation of jcache in the early stage.
Spring,Cocoon,AcegiAnd other frameworks
Generally, when combined with these frameworks to use ehcache, there is not much special. You only need to pay attention to the following points:
· Note what cache is used in these frameworks.
· Create ehcache. XML, configure the cache, and put it in your classpath path.