Given: a Java EE 5 web app that has a web.xml that has a snippet like
<context-param>
<description>c</description>
<param-name>a</param-name>
<param-value>b</param-value>
</context-param>
What would I need to do to move that context-param specification into an annotation based strategy.
If you are using Tomcat, you can use the Parameter tag in context.xml
, and it will work identical as a context-param put in web.xml
.
So you can use @WebInitParam
to catch a context variable.
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Context_Parameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With