This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi all When is recomended to store objects in the instance "application" and when in on static attributes ? As example I have a map which contanins the list of diferent sections of the site, when my jsp receives the param "sectionId" I look in this map to see if I have such key if so, I get the object and display its name amog other things. Now this work perfect but I have this feeling about using application.put() and application.get() would work better to retrive and store the data So, when should I use application and when static atrributes ?
Now this work perfect but I have this feeling about using application.put() and application.get() would work better to retrive and store the data When you use application scope, you must also need to know that these variables will be the same in all sessions. When I say all sessions, it means all sessions of all users and different sessions of the same user. These variables can(will be) vary when you re-start your application ie; restart your app server. Now static variables are a totally different typr of variables. They have nothing to do with scope. You can have static variables in any scope - application, session, page, or ???