My project is using some very old code and I can't really update it. There are some values that I would like to access in WEB-IN/web.xml/context-param. In recent version of java you could use :
HttpServletRequest servlet;
...
String myParam = servlet.getServletContext().getInitParameter("myParam");
But the method getServletContext()
doesn't exist in my project configuration.
Is there another way to gain access to the WEB-INF/web.xml/context-param for old version of java/tomcat?
Tomcat Version : Apache Tomcat/6.0.37
Servlet Specification Version : 2.5
JSP version : 2.1
According to this post, it was introduced in Servlet 3.0