| Author |
How does the container set the context/config objects?
|
Ralf Allar
Greenhorn
Joined: Feb 26, 2002
Posts: 9
|
|
Hi, I'm wondering how the container sets the ServletContext when there's no setter method inside the ServletContext class. : )
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
The ServletContext object that's passed to the application (the one that you can access) is usually just a facade to a another object that only the container can access. For instance, if you drop the following line into a JSP and run it under Tomcat, you will see that the context object made available to you is an instance of org.apache.catalina.core.ApplicationContextFacade This is the same with all the other object that the container exposes to the applications (request, response, session, etc...). The real classes behind the facade have, in addition to the methods defined in the servlet spec, any methods and properties needed by the container for setup and housekeeping. [ February 09, 2008: Message edited by: Ben Souther ]
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Ralf Allar
Greenhorn
Joined: Feb 26, 2002
Posts: 9
|
|
Ah, a facade... that makes sense. Thank you!
|
 |
 |
|
|
subject: How does the container set the context/config objects?
|
|
|