Not sure if I fully understand this question ...
Assuming your servlet is expanding HttpServlet
?
HttpServlet
implements ServletConfig
, so you can find out the parameters of the servlet using:
In web.xml
<servlet>
<servlet-class>com.acme.Foo</servlet-class>
<init-param>
<param-name>my.init.param</param-name>
<param-value>10</param-value>
</init-param>
</servlet>
To servlet:
int x = Integer.parseInt(getInitParameter("my.init.param"));
Similarly, you can get global (context-sensitive) parameters using:
<context-param>
<param-name>my.context.param</param-name>
<param-value>Hello World</param-value>
</context-param>
To servlet:
String s = getServletContext.getInitParameter("my.context.param");
, , Spring, Spring , -.