• 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

Servlet init() vs constructor

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi.....

I have a doubt that why be need init() method in servelt if

all the initialization can be done within the constructor???
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey pard, you're here to get help, right? Well, a descriptive subject will do a lot more to attract the attention of the awesome volunteers here at the Ranch who can help you out! A simple title like "servelts" which isn't even spelled correctly doesn't really make your post stand out and say "Read me!"

And as you've create another post with the same subject, how are we supposed to tell the difference? I've changed the subject for you.

Take a gander at this FAQ ⇒ UseAMeaningfulSubjectLine ⇐ for more info.
 
Bear Bibeault
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This particular question has been asked and answered a number of time in this forum. Please SearchFirst.

If I find the previous discussion, I'll post it here. But you can probably save some time by poking around.
 
Bear Bibeault
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Essentially, the life-cycle init() method gives you access to the ServletConfig instance.
 
reply
    Bookmark Topic Watch Topic
  • New Topic