Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Doubts in Web Container concept  RSS feed

 
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.
 
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
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!