I've been told that in a Spring MVC web application, when we have a Spring MVC Controller with its local variables, it is possible that multiple requests may use the same Spring MVC Controller instance.
Let's assume I have this Spring MVC Controller.
@Controller
@RequestMapping("/test/me/")
public class TestInstantiation {
private String myValue;
@RequestMapping(path = "/try", method = RequestMethod.POST)
@ResponseBody
public String execute(String input, HttpServletRequest req, HttpServletResponse httpResp) throws IOException
{
myValue = input;
//Let's have a lengtly operation here...
httpResp.getWriter().write(myValue);
}
}
If multiple clients send a request to /test/me/try
with different input values, it is possible that one may receive someone's myValue
value.
I am not sure about this claim. I'd appreciate any guidance on that.