Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Servlet Context / InitialContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Context / InitialContext" Watch "Servlet Context / InitialContext" New topic
Author

Servlet Context / InitialContext

Ben Roy
Ranch Hand

Joined: Nov 01, 2000
Posts: 70
I don't know much about ServletContext as I have been primarily working with jsp/javabeans/EJB and not really with servlets at all. If anyone knows, is it possible for me to retrieve ServletContext information from InitialContext? Is it part of the same "tree" or are they completely separate and unrelated?
Carl Desborough
Greenhorn

Joined: May 08, 2000
Posts: 22
I dont know of any connection (other than the name) between servlet and initial contexts ...
InitialContext is where you can get register and get access to objects in JNDI.
ServletContext allows a servlet to communicate with its container. Objects can be stored in and retrieved from a ServletContext (set and getAttribute) but i dont think its related to the InitialContext names.
Danny Mui
Ranch Hand

Joined: Dec 14, 2000
Posts: 42
Another point, I believe that ServletContexts can only be retrieved from servlets as well (unless you JNDI the object).
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Carl,
Are you the famous 100% SCJP from AUS ? Just curious.
regds
maha anna
Carl Desborough
Greenhorn

Joined: May 08, 2000
Posts: 22
famous? no ... but yes i did get 100% in scjp and i am from australia.
Originally posted by maha anna:
Carl,
Are you the famous 100% SCJP from AUS ? Just curious.
regds
maha anna

 
Don't get me started about those stupid light bulbs.
 
subject: Servlet Context / InitialContext
 
Similar Threads
How to use WAS Name Space Bindings
Determining the location of the file
Any Risk in Sharing the JNDI Context?
What is the name of the object that is created/maintained by the Servlet Container and contains all
ActionForm