Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how server will know ?

 
Sakthi Kani
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

How the server will know, when it can invoke init, service,destroy methods of servlet life cycle?

Thanks in advance.
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI sakthi

Init()
When a class is loaded its init method is called
(class is loaded on first request or on specifying in DD by giving <load-on-startup>tag)

service()
For each Request from client, service method is called

Destroy
When server is shutdown

hth(hope this helps--Bert Bates)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic