My real understanding is that init-params in web.xml should be placed in the body of a servlet variable, for example:
<servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>MyServlet</servlet-class> <init-param> <description>debug</description> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet>
Which works fine, but if I bring init-param outside the servlet body, it will no longer recognize it when I call getInitParam ()
Just wondering if this is possible, since I have 3 servlets that I would like to share common init parameters
source share