Categories
Java

Creating application-wide parameters with Tomcat

To set up an application-wide parameter or value like is done in ColdFusion’s application.cfm, place a snippet like the one below inside the application’s web.xml:

<context-param>
<param-name>my_param</param-name>
<param-value>1</param-value>
</context-param>

It can then be called by JSTL using its initParam scope or in any servlet using ServletContext.getInitParameter("param-name")

Share
Share