wood burning stoves 2.0*
The moose likes Servlets and the fly likes Servlet lifecycle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet lifecycle" Watch "Servlet lifecycle" New topic
Author

Servlet lifecycle

Jayakrishnan.C Chandramohan
Greenhorn

Joined: Aug 08, 2012
Posts: 11
Hi All


Can anyone please explain what happens in servlet when browser hit one http request with diagram or with step by step processs....................







regards JK
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3019
    
  35

Ideally the browser fires an HTTP request and the container providers objects for HttpServletRequest and HttpServletResponse. The rest of the story in the mid of the is up to the vendors. As you seem new to Java, you might want to go through something like Head First Java, and lately you can step into something like Head First Servlets and JSP.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 217

When your browser request for a page say. . .then control goes to controller which creates two threads of request and response and create object of the .class (now your java file becomes your servlet) file and send threads to your servlet for action. . Here the result of servlet should be dispatched or forward to your jsp file. . After forwardding to jsp. . your thread die and your Servlet life also come to end. . .
Pyla Rao
Ranch Hand

Joined: Jul 10, 2012
Posts: 50
Hi,

here is the good article about Servlet life cycle .......

http://javapapers.com/servlet/servlet-life-cycle-explain/

Thanks,
Pyla.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet lifecycle
 
Similar Threads
Creating a folder in the server
Newbie problem from chapter1 of Head First Servlets & JSP
JSP Life.
J2me brain not found
Opening a zip file from JSP page