File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes ServletContext Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContext Doubt" Watch "ServletContext Doubt" New topic
Author

ServletContext Doubt

siva chaitanya
Ranch Hand

Joined: Jul 05, 2011
Posts: 59

What does this statement do and what is the use of ServletContext i know context information shared by multiple servlets but the following code i cant able to understand
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi siva,

this refers to the current object and getServletContext() Returns a reference to the ServletContext in which this servlet is running.


There is one context per "web application" per Java Virtual Machine


So it will return the context of current object.

Regards
jatan
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575


----> this refers implicit parameter . you dont require to specify in general.


you cant do (1) as well as (2) .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletContext Doubt