Don't understand completely.
Creating the hashmap should not be the problem for someone familiar with java.
When talking about EJBs, look up annontations @Singleton @Startup to create a single instance of a stateless session bean started on deployment / start up of the application.
Then it's not necessary to create a static hashmap. You can create a hashmap as a "normal" instance variable.
And possibly @PostActivate for the method to put your code for initialization into.
1 of 1 people found this helpful
When the application is deployed, the server side stuff (singleton) is probably initalized before the web parts so before the web app context has been initialized its going to be unavailable (regardless of the singleton). Nothing to do about that.
Thanks Nicklas, that was my bad.. the jsp didn't come up because of other projects in the worksapce.
...Then it's not necessary to create a static hashmap. You can create a hashmap as a "normal" instance variable...
I don't totally understand how it works. How can I reach the hashmap I created (not static) in the @Singleton @Startup class?
You can just @EJB (or @Inject) inject it and have access to the instance.