I have to set initialization parameters based on environment to a servlet, NOT via web.xml but via code, but my servlet version is not 3.0 , so I cannot use this http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#setInitParameter%28java.lang.String,%20java.lang.String%29
I dont have access to the servlet code so I am writing a new servlet that extends it and I want to add initialization parameters via java code ..Any suggestions?
<servlet>
<servlet-name>abc</servlet-name>
<servlet-class>abc</servlet-class>
<init-param>
<param-name>abc</param-name>
<param-value>localhost:2001</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Is there a way to do the above thing(adding init-params) by extending servlet abc and setting attributes to the servlet config (overriding init())?