This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Why a JSP is not capable of prompting the client(Browser) for input rather than just waiting for one from the client. Why is this functionality not given for a JSP? JSP's cant send anything to client with being requested. Why so?
Can anyone throw some light on it, please. Thank you.
Because HTTP is a stateless protocol. JSPs live on a server. They wait on the server for a request. When they get a request, they return a response. The connection is then dropped and the JSP sits and waits for another request.
This is how the web works, it's no different with .NET, PHP, ASP, CF, etc.. [ February 15, 2005: Message edited by: Ben Souther ]
Because JSP's dynamically generate HTML pages. HTML pages are sent using HTTP. HTTP is based around a request/response cycle. Making JSPs able to request values from a client instead of waiting for the client to respond would require a different protocol, or require a pretty massive workaround, such as refreshing the page every x seconds so HTTP responses are generated very often, allowing the server to get data when it is ready to "request" it. However, this would be very bad as far as bandwith and scalability are concerned... instead of sending a page only when the user requests it, your server would *constantly* be sending pages... most of which would be the exact same as the version that had just been sent.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Nov 22, 2004
Aahhh http is a stateless protocol. I forgot that point. Ben thaks for your help. You gave the right answer. Thank you
Joined: Nov 22, 2004
this would be very bad as far as bandwith and scalability are concerned... by Nathan Pruett
I agree to you Nathan,Ben it would be a failure if tried to implement it this way. Thank you Nathan for your explanation...