Question - How to get ServletConfig and ServletContext objects in spring bean?
Answer -
This can be done by either implementing the spring-aware interfaces or by using the @Autowired annotation.
- @Autowired
- private ServletContext servletContext;
- @Autowired
- private ServletConfig servletConfig;