I need to read in a file within a controller in Spring MVC app. What is the default location where I can put a file and then within my controller I can do the following:
@RequestMapping(value="/")
public ModelAndView test(HttpServletResponse response) throws IOException{
File file = new File("simple_file_name_without_any_path_information.txt");
// reading in the file ....
}
Is there any additional configuration I need to do in order to make it work ? I tried putting the file under webapp\resources or webapp\WEB-INF or in plain webapp.
None of the options works.