The config.getInitParameter() called from within a JSP page is returning null. After changing the web.xml file numerous times and trying all the suggestions from java.sun.com and the tomcat archives I still cannot resolve this problem.
Does anyone know why we can't access the init parameters?
Just to clear up what i'm trying to do:
not having any problems getting init parameters using servlets, the following code in web.xml will achieve that:
servlet
servlet-nameMyServlet/servlet-name
servlet-classMyServlet/servlet-class
init-param
param-namedebug/param-name
OK this is how to get init-params working for JSP
Include this in your web.xml file
web-app
context-param
param-name
foo
/param-name
param-value
bar
/param-value
/context-param
/web-app
And then in your JSP page:
String s = application.getInitParameter(foo);