If your implementation of downloadReport
is Thread Safe, then you do not have to worry about this.
In the situation you describe, multiple threads will be executing downloadReport
. If all of the variables used in the execution are on each thread's stack, they won't collide. Here is a simple example to illustrate:
@RequestMapping(value = "downloadReport", method=RequestMethod.GET)
public void downloadReport(@RequestParam("reportStoreId") String reportStoreId,
HttpServletResponse response, HttpServletRequest request) {
response.getWriter().print(getReportText(reportStoreId));
}
You would need to implement getReportText
to return the text of the named report -- or something similar. As you can see, getReportText
returns the text according to its parameter. This parameter is on the thread's call stack and will be different for each request (unless, of course, the two request are for the same file).