File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ServletContext Doubt / Poll" Watch "ServletContext Doubt / Poll" New topic

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?


[ 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.


Kunal Jaggi<br />Author of <a href="" target="_blank" rel="nofollow">"SCWCD Exam Guide"</a>, SCWCD 5 (exam 310-083 and 310-084), <a href="" target="_blank" rel="nofollow">McGraw-Hill</a><br /><a href="" target="_blank" rel="nofollow"></a><br /><a href="" target="_blank" rel="nofollow"></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).
I agree. Here's the link:
subject: ServletContext Doubt / Poll
It's not a secret anymore!