Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question about the method to get ServletContext

 
jeffrey z. lee
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
there is a method getContext(java.lang.String uripath) in ServletContext, and getServletContext() in ServletConfig.what is their difference ?
 
Bala Krishna
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!