• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

AJAX XML example  RSS feed

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

One more Ajax example from w3schools.com. 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?

 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 71
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!