Results 1 to 3 of 3
Thread: ajax problem
- 12-22-2009, 08:57 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 57
- Rep Power
- 0
ajax problem
"There must be a server-side handler that will process the AJAX request. The only requirement of this component is that it return an XML file that represents a list of results based on the query passed to it from the client-side AJAX functions."
1. how do i transform java beans to xml on server side?
my java bean has name and phone number column in a row.
2. how do i extract data from xml on client side?
i know i need to use javascript to extract it but the problem is when it has multiple rows and columns.
3. Is there easier way? tnn
i encounter this link about AjaxXmlBuilder.. AjaxTags DOC - can u help me build xml from my java bean with name and phone number column in a row and lastly decode it
i have a javascript xml extractor but its only useful on a single string
(var message =
xmlHttp.responseXML.getElementsByTagName("valids")[0].childNodes[0].nodeValue;
document.getElementById("results").innerHTML=messa ge;)
- 12-24-2009, 07:45 AM #2
On the Web application server, you need a servlet to handle AJAX requests. In your client, you need code to interpret what the servlet sent back. You do not have to send or receive XML, it can be plain text or whatever.
Rather than doing this all yourself, you should find a toolkit that provides the support on both sides. Google Web Toolkit is one option. You do everything in Java in your IDE, and it will generate Javascript for your client and appropriate code for its servlet on the server. I'm sure there are other toolkits as well.
- 12-24-2009, 01:21 PM #3
Member
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 43
- Rep Power
- 0
With your JSP you can also create XML instead of HTML.
Set the ContentType of your response to XML And then create some XML Stuff.
Java Code:<%@ page contentType="text/xml"%>
You can do this with javaScript take a look at some of the JS Frameworks like jQuery, dojo, prototype ...
Yes, use some JAVA Frameworks the have a AJAX Support like Struts2 with dojo or jQuery plugin, GWT or Icefaces
Johannes
Similar Threads
-
ajax jsp tag problem (formupdate.view ?)
By anthrax in forum Advanced JavaReplies: 1Last Post: 12-20-2009, 04:51 PM -
JSP - AJAX problem
By MaheshReddy in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-27-2009, 01:54 AM -
Jsp with Ajax
By sundarjothi in forum JavaServer Pages (JSP) and JSTLReplies: 16Last Post: 09-25-2008, 10:29 AM -
Problem reading an xml file with AJAX
By Fiona80 in forum XMLReplies: 0Last Post: 12-17-2007, 08:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks