I have defined several application parameters for my webapp in the web.xml file, as follows:
<context-param>
<param-name>smtpHost</param-name>
<param-value>smtp.gmail.com</param-value>
</context-param>
If I have a ServletContext Object object available, I can access them easily . For example in my Struts action classes.
ServletContext ctx = this.getServlet().getServletContext();
String host = ctx.getInitParameter("smtpHost");
How can I retrieve application parameters without passing ServletContext object around?