Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts in Web Container concept

 
kalle suresh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one quick question on Container concept. On page 42 (HeadFirst Servlets & JSP book), talking about containers it was written like, once the request comes from the client container creates a HttpServletRequest and HttpServletResponse objects and those acts as a reference for the clients request and response. After that container creates a thread for that servlet and passes these request and response objects to the thread and calls the service method. Here i'm not able to understand who will call the threads start method and what will be the code in the created thread's run() method .

Code example for that thread class will be very helpful.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Container calls the thread start method.
 
kalle suresh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What could be the code in created thread's run method.how it is interlinked with service() method
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a very recent similar topic here:
http://www.coderanch.com/t/176083/java-Web-Component-SCWCD/certification/Thread-ll-Created-Run-but

The most important thing is that you don't have to worry about how it's done. That's the beauty of having the container - some of the work is already done for you and you don't have to care how it works internally. You only need to know how it works on the surface and how to interact with it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic