I'm afraid you are mixing concepts here....
Properties files are plain text files containing key-value-pairs to store configuration and read them during runtime. They have little in common with your problem.
Stateless and statefull beans are again something different. A statefull bean may have an internal state. That is two calls to the same method may yield different results even though the context (db-contents etc) did not change.
So what is the way to achieve caching? There is not built-in utility to cache DB-requests. The most simple (but as well naive) approach would be something like
private final Map<String, String> componentCache = new HashMap<>();
public String getComponentMarkup(String componentId, String... parameters){
//Build a key for the parameters. Maybe simple stringconcatenation.
String key=buildKey(componentId, parameters);
if (!componentCache.containsKey(key)){
//Delegate the call to the "old" method which queries the database.
String component = getComponentMarkupFromDb(componentId,parameters);
componentCache.put(key, component);
}
return componentCache.get(key);
}
But the bottom line is you should think about why you want to implement the cache by yourself. There are tons of well tested solutions for you problem (spring, hazelcast, etc...).
Your question indicates a not invented here syndrom...