This is the statement:
System.out.println("getServletContext : " + request.getServletContext().getRealPath(File.separator));
Output:
getServletContext : null
This is the statement:
System.out.println(request.getServletContext());
Output:
org.apache.catalina.core.ApplicationContextFacade@1cb0b163
I need the actual file path, because I need to upload my files inside the application directory.