Now if i am not wrong then i think at this time i am requesting for the page LoginUser . Now further if i will eneter wrong password two or three time then that password will be validiated by server then at this time what happen ?
if i will enter wrong password then will a new request will created for this page or not? In this case when will seesion created or when will destroyed. please specify me i am getting confuge about session and request.
A session, or more accurately, an HttpSession, is probably the most important object in the entire Servlet API. Its importance cannot be understated.
First of all, an HttpSession object has nothing to do with a Session EJB, so let�s get that association out of your mind right away. It is a completely different monster. An HttpSession is a server-managed component completely independent of the EJB spec. The Session Issue
Here�s the issue: the http protocol, the mechanism we use to surf the Internet and browse websites, is stateless. Once a Web server is done handling a client request, the web server completely forgets about what it just did, kinda like that fish in Finding Nemo.
The http protocol treats every request as a brand spanking new, unassociated request, regardless of how many client-server interactions may have happened with a particular client in the past.
A web server, using the http protocol, doesn�t maintain any meaningful state with a client.
A stateless protocol, such as http, causes all sorts of problems for our web-based applications. For example, if someone surfs to our site and sees a product they want to buy, we want to keep track of that information until the user decides to check out.
Or perhaps a user is taking an online exam: we would want to keep track of every answer the user has provided. The http protocol provides no mechanism for keeping track of a user�s actions from one invocation to the other. That�s where the Servlet API, and more specifically, the HttpSession, comes in.