Subject: Where can I find the property file? -- classes folder
Author: EricJ
In response to: Where should I put my resource file? -- resource folder
Posted on: 08/26/2013 06:06:39 PM
As an end user, you may want to adjust the property to your need. You should find the property file in the classes folder:
Relative path:
[+]---WebContent
[+]---WEB-INF
[+]---classes
[+]---org
[+]---test
[+]---example
[-]---HelloEhcache.class
[-]---ehcache.xml
Absolute path:
[+]---WebContent
[+]---WEB-INF
[+]---classes
[+]---org
[+]---test
[+]---example
[-]---HelloEhcache.class
[-]---ehcache.xml
>
> On 08/26/2013 06:04:19 PM
EricJ wrote:
If you are a developer and you want to get the following instance generated correctly:
try{
ehcache_manager = CacheManager.
create(this.getClass().getResourceAsStream("ehcache.xml"));
}catch(Exception e){
e.printStackTrace();
}
the property file 'ehcache.xml' which is used to customize your ehcache should be put under:
[+]---src
[+]---org
[+]---test
[+]---example
[-]---HelloEhcache.java
[+]---resource
[+]---org
[+]---test
[+]---example
[-]---ehcache.xml
and include the resource folder as your source. After compilation, the resource files should be copied onto under classes folder together with source
files.
[+]---classes
[+]---org
[+]---test
[+]---example
[-]---HelloEhcache.class
[-]---ehcache.xml
You may want to use absolute path as:
try{
ehcache_manager = CacheManager.
create(this.getClass().getResourceAsStream("/ehcache.xml"));
}catch(Exception e){
e.printStackTrace();
}
the property file 'ehcache.xml' which is used to customize your ehcache should be put under:
[+]---src
[+]---org
[+]---test
[+]---example
[-]---HelloEhcache.java
[+]---resource
[-]---ehcache.xml
References: