I want to capture the responseXML that i have built in my jsp. What should I do. after that i will transform it in html. I know this is annoying and we could do it with a framework or a library like jquery but i realize it with ajax. Also i 开发者_运维问答have problems with jquery and jsp\servlet since i must use a JSON SERVICE. Why it seems to me that is so complicated.
It doesn't need to be that complicated. You maybe just need to align all the technologies out one by one yourself. JSP, Servlet, JavaScript, HTML DOM, HTML and Ajax are all separate technologies which needs to be learnt and understood separately. Trying everything together at once without understanding them separately will indeed likely lead to more confusion, complication and frustation as you encountered. Follow the given links to learn about them separately. Learn walking before running or cycling.
The jQuery library just removes the need to write/duplicate all the code to keep it all crossbrowser compatible. Only executing an Ajax request the crossbrowser way is already far over 10 lines of (well-writen/indented) code. jQuery brings it to an minimum, an oneliner is possible.
To learn more about the wall between JavaScript/Ajax and Java/JSP/Servlet, you may find this article useful. I've posted several answers before how to get JSP/Servlet/Ajax to work together (although in combination with JSON and jQuery, but almost everyone will agree that JSON and jQuery are the way to go; JSON is easy to generate/parse in Java using Google Gson and is easy to build/access/process in JavaScript as it is the language's own nature; jQuery is actually a revolution in the way you use JavaScript). Here's a good starting point to find code examples I posted before.
Hope this helps.
精彩评论