I have a context parameter defined in tomcat server config xml for a given webapp. I want to use this value in a spring mvc controller.
How do I achieve this? How do I make the context param visible to the spring controller?
Inject the ServletContext
in your @Controller
.
@Autowired
private ServletContext context;
and use it to retrieve the context parameter
context.getInitParameter("param-name")