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?
thanks in advance
Here is what my web.xml file looks like (does not work):
<web-app>
<servlet>
<servlet-name>
Error
</servlet-name>
<servlet-class>
org.apache.jasper.runtime.JspServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
</web-app>
and my JSP code:
<%
String s = config.getInitParameter("debug");
if (s == null) {
out.println("Init param must be null!");
}
else{
out.println("Init param is "+s);
}
%>
- Re: config.getInitParameter() still returning null Michael . Murphy
- Re: config.getInitParameter() still returning nu... Chen JUn
- Re: config.getInitParameter() still returning nu... Bo Xu
- Re: config.getInitParameter() still returning nu... Michael . Murphy
- request.sendRedirect() Paolo Barolat-Romana
- Re: request.sendRedirect() David Crooke