ServletContext « MVC Controller « Spring Q&A

1. How can I get ServletContext in Controller?

hi, i'm a beginer of spring. i want to get the real path using servletContext.getRealPath("/upload/"), but how can i get ServletContext in a Controller's handleRequest() method? thank you!

2. wiring a controller with a ServletContext attribute

3. How to get ServletContext from class which extends Controller

Hi all, can you please help me how to get servlet context from bean class which extends Controller class. because only the dispatcher servlet extends httpservlet.

4. How to get the ServletContext when using annotated controllers

Hi All, I'm trying to get the path to upload a file using getServletContext().getRealPath(""); inside an annotated controller, but it gives an error message saying undefined. But when I tried it ...