Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet context

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends...
please tell me where does the servletContext interface is implemented,HttpRequest,HTTpresponse,are implemented... i had gone through tomcat library.....but i never found the implementaion by the tomcat...... is it so they are imoplementd intenally in service method or is there any jar files regarding the implementation.............
 
Aakash Parashar
Ranch Hand
Posts: 123
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh.R gowda wrote:hi friends...
please tell me where does the servletContext interface is implemented,HttpRequest,HTTpresponse,are implemented... i had gone through tomcat library.....but i never found the implementaion by the tomcat...... is it so they are imoplementd intenally in service method or is there any jar files regarding the implementation.............


Implementation of ServletContext, HttpRequest, HttpResponse etc are done by container provider.

When we access ServletContext, its the object of ServlectContext type of implementation which is passed by container to Servlet.

I never tried to find out class in Container which implement these Interfaces provided by Servlet Specs. I would suggest you to browse servlet.jar.
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether they are internally implemented or they are class files of the implementation........
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi,

For better understanding, remember every servlet have their own servlet context object.

So, when you extend your class with HttpServlet class you explicitly access your servlet "servlet context" object.

So, no need to implement your class to "servletcontext" interface.


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since Tomcat is open-source, you can download the complete Java source code and explore the actual implementation. However this is not necessary - all you need to program for the servlet environment is the servlet specification and the JavaDocs for the API.

Bill
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks all of you....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic