Hi I'm trying to access an intialisation parameter in a jsp file. My web.xml file has the following entry <servlet> <servlet-name>Jsp1</servlet-name> <display-name>Jsp1</display-name> <jsp-file>/Jsp1.jsp</jsp-file> <init-param> <param-name>myInitial</param-name> <param-value>Y</param-value> </init-param> </servlet> Using config.getInitParameter("myInitial")in the JSP always returns null!!! Has anyone else had these problems and sorted it out. TIA Graham
hi, let me disagree with the last post. to use the context parameters you set the <context-param> tag, and not <init-param>. i guess you get your init parametes == null because you have to call your servlets with path which includes your <servlet-name> and not the direct path.
I know this was a while ago. but I got the answer for you. The problem was after you set up your servlet context for your JSP, you need to set up a servlet mapping so the web server can map the servlet context to your jsp! Like this: