*
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
 
subject: question about the method to get ServletContext
 
Similar Threads
ServletContext object
From wher log methods come in GenericServlet
Context Path Issue in Struts
What is the name of the object that is created/maintained by the Servlet Container and contains all
ActionForm