wood burning stoves 2.0*
The moose likes JSP and the fly likes Application variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Application variables" Watch "Application variables" New topic
Author

Application variables

Gaelle SMITS
Greenhorn

Joined: May 16, 2002
Posts: 23
Hello !
I would like to know : what exactly can I store in the application object ? (using application.setAttribute, for example)
I have a Vector that is used by any user of my intranet site, can I store it in the application object so that anyone can access it ?
Then : how long does such an application variable live ? Is it persistent ?
Thanks !
Gaelle.


Gaelle.<br />'Never forget to abuse of good things'
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
If you set application attributes they will be available until the application server is shutdown or until they are explicitly removed.
They are NOT persistent i.e. they will not be there if the server is shutdown and restarted. I would advise caution when using them however as you need to take issues like server clustering and they could potentially take up large amounts of memeory.


Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Application variables
 
Similar Threads
Storing an Java object in Access
Tapestry JavaBeans across pages
passing parameters in jsp
How to store SecretKey in database?
How to transfer Objects from JSP to a Servlet?