How do I mutate the DOM of a displayed HTML page, via Java, over HTTP (from the server)? -
i reference dom of displayed webpage can add , remove elements. add , remove elements sending http requests from, say, servlet. further, able construct dom, node-by-node, in browser, via java, http messages coming said servlet.
suppose requests url (say): http://helloworld.xhtml
i render content sending http messages, which, node node, build displayed document. then, if need change in document, able remove html node-wise, or add html in same manner; make partial changes html document via http.
does know of specific way(s) accomplish this?
i don't want use javascript, unless means utility method accomplish communication mechanism only. don't want use client-side applet either, might way of getting around limitations of http (i.e., sending java object responses via jaxb).
i don't want use javascript because want use html browser displayer of elements relay occurence of events server. then, want able add or remove elements without redrawing page. also, use xslt generate html, again, way of updating web page without using hidden elements , without redrawing whole page.
i thought of else also. might use japplet embedded in html page, , communicate japplet via jaxb? assuming can that.. (maybe not work way). then, in japplet, using means of displaying html page; there might better option amongst components jlabel.
i think best option either using http mechanism (if possible) or else, using sort of middle layer enable me send java , forth between webpage , server.
i've thought minute, , perhaps, if browsers change update policy, then, able use http facilitate view updateable on per-element basis, via browser behavior supports additions or subtractions of elements?
why don't want use js beyong me since language editing dom.
the easiest way accomplish scenario using jquery.ajax.
for parsing/building json recommend google's gson.
you can here small sample.
Comments
Post a Comment