I'm aware that Spring MVC controllers are Singletons.
So, using the controller's fields to store data can result into security issues.
What by question is, suppose it have a mapping which allows users to download a file -
@RequestMapping(value = "downloadReport", method=RequestMethod.GET)
public void downloadReport(@RequestParam("reportStoreId") String reportStoreId,
HttpServletResponse response, HttpServletRequest request) {
// use reportStoreId to fetch a report from file system and pass it to user using PrintWriter, response.getWriter(), etc...
}
so if multiple users request to download files with different IDs at the same time, could it lead to one user getting a file requested by another user ?