• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

who calls service method ?

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i have got bunch of questions about servlet and life cycle.

Who calls service method & which class implements the service method ?


and if i deploy one web application today and tomorrow i undeploy it. in 1 day if i get 100 request.

how many times init() will be called ?
how many times service() method will be called ?
and how many times destroy() will be called ?

Thanks & Regards,
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A good place to start would be the servlet spec.
The section on the servlet life cycle is clear and well written.
You can find a link to this document in my signature.

Anyway.
The container calls the service method whenever a request comes in.
Init and destry will most likely be called once. (containers are free to take servlets out of commission to save resources). Each time it is taken out of service, the destroy method is called. Each time it it put into service, the init method will be called.
[ March 26, 2008: Message edited by: Ben Souther ]
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i was posting the question i was knowing your answer.. "Servlet Spec"

Thanks... Will refer the servlet spec for "who calls service method "
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
The container calls the service method whenever a request comes in.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic