File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets" Watch "servlets" New topic


mahender ch

Joined: Oct 13, 2010
Posts: 1
why we should use <context-param> tag in web.xml file?
Ankit Garg

Joined: Aug 03, 2008
Posts: 9466

Nothing to do with Struts, moving to servlets forum.

Mahendrer please check your private messages for some administrative matter. Also go through these guidelines once...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

Please be sure to take the time to compose descriptive subjects for your posts. You will attract people who will can give you better and faster answers when your posts have good, descriptive subjects. For more information, please click this link ⇒ UseAMeaningfulSubjectLine.

Using a title of "servlets" in a forum completely dedicated to questions on Servlets isn't going to attract the attention of those who can best help you. You can change your subject line by clicking the button on your post.

[Asking smart questions] [About Bear] [Books by Bear]
Phoenix FireBird

Joined: Oct 15, 2010
Posts: 3
mahender ch wrote:why we should use <context-param> tag in web.xml file?

I believe I can answer it here: If not, then I apologize

You should be writing <context-param> tag in the web.xml file only and only if you wish to pass some application level data when the application is getting initialized. Whatever parameter data that you are passing through the web.xml file can in turn be accessed by the servlets through the ServletContext object, as and when needed.

Hope that helps.

(The truth shall set you free)
I agree. Here's the link:
subject: servlets
It's not a secret anymore!