Hello All, I'm trying to set JSP initialization parameters in the web.xml file <servlet> <servlet-name>listener</servlet-name> <jsp-file>/info.jsp</jsp-file> <init-param> <param-name>track</param-name> <param-value>/track.jsp</param-value> </init-param> </servlet>
I, also tried setting the context params: <context-param> <param-name>track</param-name> <param-value>/track.jsp</param-value> </context-param>
Here is the JSP Code: info.jsp -------- Reading param vaue= <%= getServletConfig().getInitParameter("track")%><br>
Reading context param vaue= <%= application.getInitParameter("track")%><br> The problem is that I'm getting 'null' for both, jsp params and context params....
Joined: Jan 26, 2006
I thinki go the reply....i missed out the mapping tag...without that it seems things don't work...here is the web.xml file
Use EL implicit objects to access context params
However, I don't think EL has a way to access JSP initialization parameters directly. You'll have to work around it.
One workaround would be to write a tld - map the getParameterName method and then include this tld in your jsp page and use el to invoke the method.
Someone might be able to suggest a better work around though.
SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD