File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes config.getInitParameter   does'nt work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "config.getInitParameter   does Watch "config.getInitParameter   does New topic

config.getInitParameter does'nt work

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I am unable to access the inititalisation parameters with config.getInitParameter() method. But I could do the same thing with application.getInitParameter(). why ?
what is the diff between these two methods? Can anybody help.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Please note that The Java Ranch has a naming policy, described here and "meena m" is not a valid name. Please choose one which meets the requirements.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
This is usually because your servlet redefines init, but does not call super.init as its first action. Check your init.
meena murugu

Joined: Jan 03, 2001
Posts: 2
I am calling these methods from jsp page as follows:
<%= config.getInitParameter("var1") %>
<%= application.getInitParameter("var1") %>
and only the 2nd one works. I initialised the parameter thru' the application server JRUN.

I agree. Here's the link:
subject: config.getInitParameter does'nt work
It's not a secret anymore!