aspose file tools*
The moose likes Servlets and the fly likes How do you pre initialize servlets in a webcontainer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How do you pre initialize servlets in a webcontainer?" Watch "How do you pre initialize servlets in a webcontainer?" New topic
Author

How do you pre initialize servlets in a webcontainer?

shankhas sanyal
Ranch Hand

Joined: Jun 15, 2008
Posts: 45
Hi all
recently i attended an interview and the interviewer asked me :

How do you pre initialize servlets in a webcontainer?

Can anybody please help me find the answer?

Thank you!

Shankha


I love this place!
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

You can declare initialization parameters in web.xml of your web application. You can use that initialization information to initialize your servlet in the init() method of the servlet!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
shankhas sanyal
Ranch Hand

Joined: Jun 15, 2008
Posts: 45
Abimaran Kugathasan wrote:You can declare initialization parameters in web.xml of your web application. You can use that initialization information to initialize your servlet in the init() method of the servlet!


Oh wow! That's so cool! thanks!!
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

You are Welcome!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61657
    
  67

If you are going to be working with servlets, it'd be a good idea to read through the Servlet Specification to learn things such as this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you pre initialize servlets in a webcontainer?