I need to know how this works:
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
This means that, some where when the server receive the request (actually the Faces APIs who do that) , it did something like:
FacesContext fx = new FacesContext();
fx.setRequest(httpServletRequest);
FacesContext.setCurrentInstance(fx);
so.. suppose this scenario:
one request sent ... the FacesContext object populated .. and then it waits 5 seconds (by any mean, for example using Thread.sleep()
) in this while .. another request sent who - by my understanding- will override the contents of the FacesContext.getCurrentInstance()
object .. so when the previous request came from the sleep, it will read the overriden contents..
Is my understanding true???