I needed to cache some values from the DB into the application as they are static values and used across the application. I am using struts2 and springs jdbc for DB access. I was wondering where should be the best place to do this, is there any facility in struts 2 or should i use springs to do this, tried to find something about spring caching, but looks complicated..lol..or should simply use an onload servlet make pure jdbc calls and cache the parameters / values, which i thought would not be the wisest choice..
Would appreciate suggestions, also where could i find something on spring caching that is simple to understand and write as the job required is pretty simple..
you can use any Caching product out there. If you wanted to preload data into the cache, then you could create a Spring bean for it and make an init method. In xml that would be <bean init-method="nameOfMethodToRun"/>
or put the
@PostConstruct annotation on the method you want to run. and include
<context:annotation-config/> in your xml
By the way the framework is the Spring Framework, there is no plural like there is in Struts.