aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Lifecycle management of servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Lifecycle management of servlets" Watch "Lifecycle management of servlets" New topic
Author

Lifecycle management of servlets

Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

How can we say, that, the Container controls the life and death of servlets? Since servlets are not object?

Thanks in Advanced!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

Abimaran Kugathasan wrote:Since servlets are not object?

Ummmm, yeah, they are. What did you think they were?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Bear Bibeault wrote:
Ummmm, yeah, they are. What did you think they were?


Thanks Bear Bibeault! I found that, they(servlet) also, a object, and when a request come to a particular servlet, the container creates a Thread, and the Thread will communicate with the servlet, this from Head First JSP ans Servlet book, but I didn't noticed any Thread when the application is running? Is it implicitly functioning?

Thanks in Advanced!
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

I didn't noticed any Thread when the application is running?

A thread is automatically created by the container to serve every incoming request. How did you check if there were any threads running in the application??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Ankit Garg wrote:
..How did you check if there were any threads running in the application??


, there are no references to refer them! No invocation of any start(), run(). That's why I asked! Thanks Ankit!
Rajeev Rnair
Ranch Hand

Joined: Mar 22, 2010
Posts: 308

One responsibility of the container (among several others) is the Thread Management. The container (eg: Tomcat) will maintain a pool of Thread objects or create new Threads as and when needed. In the case of new servlet request comes in from user, it will either create a new Thread or assign a Thread from the Thread pool to serve this request! Container will call the start() method.


SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Thanks Rajeev Rnair, I got it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lifecycle management of servlets
 
Similar Threads
server side processing error
Downloading HTML page
WA #1.....word association
a jsp design question...
Un-downloadable Applets