Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Using Servlets in Java

how to run servlet in java how to connect servlet java programming servlet

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 ramesh123


    CC Lurker

  • New Member
  • Pip
  • 6 posts

Posted 09 October 2012 - 11:18 PM

Servlets are Java server-side programs that accept client’s request (usually http request), process them and generate (usually http response) responses. The requests originate from client’s web browser and are routed to a servlet located inside an appropriate web server. Servlets execute within a servelt Container which resides in a web server like Apache Tomcat. The newer release of Tomcat has a JSP (java server pages) container also in it. Normally HTTP (hyper text transfer protocol) is used between web client and servlets, but other protocols like FTP (file transfer protocol) can also be used.
Life Cycle of Servlets
Servlets have their own execution life cycle. The lifecycle includes three methods:
Posted Image
Whenever a client request is received by the servlet container (part of a web server)
  • Locates the servlet responsible for handling the request and loads it.
  • Instantiates it.
  • Initializes the servlet by calling intit () method, followed by service and destroy.
The init() method is called only once during the lifetime or an applet. One time initializations are done in this method.

Edited by BenW, 10 October 2012 - 10:18 AM.
Fixed thread title

#2 BlackRabbit


    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 15 December 2012 - 05:07 AM

Useful! nicely done, thumbs up!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download