Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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: 42975
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!