| Author |
How do you set a servlet context attribute?
|
Dave Alvarado
Ranch Hand
Joined: Jul 02, 2008
Posts: 434
|
|
Hi,
I'm using Tomcat 6.0.26. I have this in my web.xml file ...
But in my servlet, this call returns null ...
So my question is, what is the right way to set an attribute of a servlet context?
Thanks, - Dave
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
Wrong method. Check the API again.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Dave Alvarado
Ranch Hand
Joined: Jul 02, 2008
Posts: 434
|
|
Come on, man, I need a little bit more than that. What is the "wrong method"?
|
 |
Poobhathy Kannan
Ranch Hand
Joined: May 26, 2004
Posts: 94
|
|
|
i think you should have used ServletContext#getInitParameter method
|
http://learnertobeginner.blogspot.com/
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
Dave Alvarado wrote:Come on, man, I need a little bit more than that. What is the "wrong method"?
Learning to read the Javadoc is an important skill.
|
 |
Elchin Asgarli
Ranch Hand
Joined: Mar 08, 2010
Posts: 222
|
|
Bear Bibeault wrote:
Dave Alvarado wrote:Come on, man, I need a little bit more than that. What is the "wrong method"?
Learning to read the Javadoc is an important skill.
And what about this? http://faq.javaranch.com/java/BeNice
|
Personal page, SCJP 6 with 91%, SCWCD 5 with 84%, OCMJD
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
What is not nice about teaching people something?
|
 |
Madhawi Maurya
Ranch Hand
Joined: Aug 22, 2007
Posts: 42
|
|
Hi,
you should write like
|
SCJP1.5 with 90%
|
 |
 |
|
|
subject: How do you set a servlet context attribute?
|
|
|