• Post Reply Bookmark Topic Watch Topic
  • New Topic

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


 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!