In web.xml I have two initial parameters name Premier and Regular. To show you the code this is it.
<servlet>
<servlet-name>StockServelt</servlet-name>
<servlet-class>test.StockServelt</servlet-class>
<init-param>
<param-name>Premier</param-name>
<param-value>/Premier</param-value>
</init-param>
<init-param>
<param-name>Regular</param-name>
<param-value>/Regular</param-value>
</init-param>
</servlet>
I have Create two constants (named PREMIER AND REGULAR) and I want to retrieve the configuration intial parameters name "Regular" and "Premier".
This is my code for that. I am not sure I am doing this part right or not
final String PREMIER = getServletContext().getInitParameter("Premier");
final String REGULAR = getServletContext().getInitParameter("Regular");
Here I print both to the console make sure that I retrieved correctly. But I am getting a null for both
System.out.println("This is the value for Premier: " + PREMIER + " "
+ "and this is the value for Regular: " + REGULAR);
Can someone please help me out her what I am doing wrong.