Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Bear Bibeault wrote:I'm not sure what you are asking. Are you asking if a servlet can be used to service the Ajax request? If so, then yes. From the point of view of the server, it's just like any other request.
If it's something else you are asking, you'll need tone clearer regarding your question.
Jelle Klap wrote:Sure, you could implement a Comet model using Java technology on the serverside and JavaScript on the clientside.
This might be a useful article.
Sean Michael Hayes wrote:What I want to know is if I could send an ajax request from java code, have the servlet handle the request and have it be sent it to the jsp, where the jsp will read the object name sent by the POST and overwrite the div that shares the name of the object with the new data.
Paul Clapham wrote:
Sean Michael Hayes wrote:What I want to know is if I could send an ajax request from java code, have the servlet handle the request and have it be sent it to the jsp, where the jsp will read the object name sent by the POST and overwrite the div that shares the name of the object with the new data.
In other words, you send the request to the servlet, which handles the request and then forwards to the JSP, which generates the HTML to be put into that div? Yes, that's what you should always be doing.
Jelle Klap wrote:Sure, you could implement a Comet model using Java technology on the serverside and JavaScript on the clientside.
This might be a useful article.
Sean Michael Hayes wrote:The main reason I wanted to do a server push method was concerns over scalability. I could ,in theory, have hundreds of machines having their data returned even though there has been no change in their values. I just don't want unnecessary or redundant things happening in my app.
Consider Paul's rocket mass heater. |