wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ServletContext Doubt / Poll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ServletContext Doubt / Poll" Watch "ServletContext Doubt / Poll" New topic
Author

ServletContext Doubt / Poll

Muks Sam
Ranch Hand

Joined: Apr 09, 2004
Posts: 47

Hi Ranchers,

I have a quick question if somebody can help.

"Which implicit object can access the attributes from the ServletContext?"

1. Server
2. context
3. application
4. Application
5. ServletContext

My sincere request to you is, Please poll your answer and in brief tell me why do you think so and why not other options?

Thanks

JD
[ June 25, 2008: Message edited by: John Doe ]
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
application, because it is a ServletContext object.


SCJP 1.4 (81%)<br />SCWCD 5 (95%)
Kunal Jag
Ranch Hand

Joined: Jun 08, 2008
Posts: 31
The application variable contains a reference to a ServletContext instance. Each web application has a distinct ServletContext reference. The ServletContext provides access to shared resources in a Web application. A single instance of a ServletContext is available to all servlets and JSP pages in a Web application.

Regards,


Kunal Jaggi<br />Author of <a href="http://www.tatamcgrawhill.com/html/titleDetail.jsp?isbn=9780070249103.html" target="_blank" rel="nofollow">"SCWCD Exam Guide"</a>, SCWCD 5 (exam 310-083 and 310-084), <a href="http://www.tatamcgrawhill.com/html/titleDetail.jsp?isbn=9780070249103.html" target="_blank" rel="nofollow">McGraw-Hill</a><br /><a href="http://javaevangelist.com/" target="_blank" rel="nofollow">http://javaevangelist.com/</a><br /><a href="http://www.oreillynet.com/pub/au/2669" target="_blank" rel="nofollow">http://www.oreillynet.com/pub/au/2669</a>
Dee Brown
Ranch Hand

Joined: Jun 14, 2008
Posts: 94
It (application) is also the only implicit object in the list.
Anand Bhatt
Ranch Hand

Joined: May 30, 2007
Posts: 189
First "application" is the only implicit object available here.
And this only can access the ServletContext as its clear that:
1: The application implicit object is an instance of javax.servlet.ServletContext. It refers to the overall web application environment that the JSP belongs to.
2: A typical use of the "application" object is to get access to the application wide initialisation parameters(i,e. ServletContext).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ServletContext Doubt / Poll