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

Thread'll Created with Run ,but how Service Thread

 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In J2SE,Thread Start running from Run Method ,but how Service Method in
Servlets?

is it something like this at somewhere ?called by the container....


public void run()
{
service(request,response);
}
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container calls the service method of the servlet after loading and initialising n instatiating it....thers no run() method that calls the service() its the container that calls it.
 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry Loading instatiating and initialising...the correct order
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so...

By that ,you are breaking basic Java rules....
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's more than likely some kind of Threading with start() and run() going on in the container's code, but we don't have to worry about it. All we have to care about is how we interact with the container. Since it is best to allow the container to handle its own threading, we never have to worry about creating threads.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic