Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext Doubt / Poll

 
Muks Sam
Ranch Hand
Posts: 47
Java MyEclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application, because it is a ServletContext object.
 
Kunal Jag
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Dee Brown
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It (application) is also the only implicit object in the list.
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic