tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Cheshire <cchesh...@bigredwire.com>
Subject NPE with getContext() in a jsp
Date Fri, 15 Aug 2003 22:19:54 GMT
Hi,

Using tomcat 4.0.24, I have some <context-param>s defined in my web.xml.

In my servlets, I am able to access these values with

getServletContext().getInitParameter("some name")

However, if I try and do the same from a jsp page in this web 
application I get the following NPE

java.lang.NullPointerException
        at 
javax.servlet.GenericServlet.getServletContext(GenericServlet.java:204)
        at org.apache.jsp.main_jsp.getIntContextParam(main_jsp.java:45)
        at org.apache.jsp.main_jsp.<init>(main_jsp.java:73)
.......

It appears getServletContext() is the culprit. How do I retrieve the 
<context-param>s from my jsp?

Thanks

Chris



Mime
View raw message