my dog learned polymorphism
The moose likes XML and Related Technologies and the fly likes AJAX XML example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "AJAX XML example" Watch "AJAX XML example" New topic

AJAX XML example

Aditya Kanitkar
Ranch Hand

Joined: Aug 08, 2009
Posts: 72

One more Ajax example from It is about fetching from an XML file with AJAX technology.

To fetch data from Ajax file an ASP code is written.

I want to implement the same logic in JSP.

Can anyone give me some idea?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Are you asking how to replace XML handling code written in ASP by XML handling code in Java/JSP? The code seems pretty straight-forward to me; are you familiar with the Java XML APIs? If not, then the Xmlfaq points to various introductory materials.
Deepak Kumar Jena
Ranch Hand

Joined: Sep 08, 2010
Posts: 68

Sunderam Goplalan
Ranch Hand

Joined: Oct 10, 2011
Posts: 86
In JSP the code would be similar. You can wrap the XML retrieval in a <script> tag
You would make the AJAX request and get the data in the onload handler like so.

Here is one way to implement the callback

SCJP 5.0 , SCEA Java EE 5, TOGAF Certified
I agree. Here's the link:
subject: AJAX XML example
It's not a secret anymore!