File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Sharing Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Sharing Objects " Watch "Sharing Objects " New topic
Author

Sharing Objects

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
if i want to share objects between different sessions i would get a HttpSession and use the setAttribute method. Please how do i make my object available to the whole application
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

Originally posted by Abiodun Adisa:
if i want to share objects between different sessions i would get a HttpSession and use the setAttribute method.
No. That would only make the object (termed a scoped variable) available to the same session.

Please how do i make my object available to the whole application
You can create the scoped variable in application context by calling setAttribute() on the servletContext.
[ December 01, 2007: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Sharing Objects
 
Similar Threads
how many objects will be created.
why we use object oriented programming
Write to File
First class object -- what is it?
problem with wsdl2java in Axis