| Author |
servletcontext
|
Neeraja Neeraj
Greenhorn
Joined: May 11, 2003
Posts: 29
|
|
can anybody pls let me know the difference between the methods: 1.getServletContext() 2.getServletConfig().getServletContext() How does the ServletContext returned by these two methods differ? Thanks Neeraj
|
 |
Jason Qiu
Greenhorn
Joined: May 20, 2003
Posts: 13
|
|
can anybody pls let me know the difference between the methods: 1.getServletContext() 2.getServletConfig().getServletContext() How does the ServletContext returned by these two methods differ? There is no any difference! Acctually, they are the same method. Please note that the GenericServlet implements the ServletConfig interface as well as Servlet interface. And all HttpServlets are children of GenericServlet. getServletContext() is defined in ServletConfig interface and is implemented in GenericServlet. So you can use either the getServletContext() of HttpServlet or use the getServletContext() of the ServletConfig. They are absolutely the same!
|
 |
Andres Bonifacio
Greenhorn
Joined: May 16, 2003
Posts: 19
|
|
|
This is additional info. Look at the source code of GenericServlet. The method getServletContext() encapsulate calls to getServletConfig().getServletContext()
|
<a href="http://weblog.homelinux.com/blojsom/blog/" target="_blank" rel="nofollow">http://weblog.homelinux.com/blojsom/blog/</a>
|
 |
 |
|
|
subject: servletcontext
|
|
|