aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question  about the method to get ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question  about the method to get ServletContext" Watch "question  about the method to get ServletContext" New topic
Author

question about the method to get ServletContext

jeffrey z. lee
Ranch Hand

Joined: Mar 21, 2002
Posts: 40
Hi,
there is a method getContext(java.lang.String uripath) in ServletContext, and getServletContext() in ServletConfig.what is their difference ?


jeffrey z. lee
Bala Krishna
Ranch Hand

Joined: Jan 26, 2001
Posts: 95
Hi Jeff,
The getServletContext() in ServletConfig returns a reference to the ServletContext object for [I] the same [italics] web application. The method in ServletContext takes a path to OTHER web applications in the same server, and returns a reference to that OTHER web application hosted on the same server. Hope this helps.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: question about the method to get ServletContext