• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Problem with xmlhttp.responseXML

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying a Simple Ajax Example of Populating a DropDown depending upon the value selected.... It looks pretty Starighforward.. I did most of the changes since last couple of day ....but still not able to identify the problem yet....

This is my JS Code



My HTML CODE






Any Help would be appreciated I am clueless that why I am not getting the XML request Back the code looks ok to me ... even the content type is set to text/xml
 
Marshal
Posts: 67339
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.
 
Marshal
Posts: 24927
61
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some unfathomable reason you are outputting that data from Java scriptlets in a JSP. It would have been much simpler to just use a servlet containing that code. But more to the point, since it's a JSP maybe the container sensibly assumes you're going to use it to output HTML and therefore sets the content type to text/html? At any rate you should check at the client end to see what content type you are actually getting.
 
Ameya Thakur
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the updates .. I would write a servlet and check it ... apart from that do you see any issues in the code or it is just the container which is setting the output back to html.... is there any way where in we can enforce this behaviour through servlet as I have already set the content type in the JSP

I just looked in the genertated class and here it is .... it sets the content type back to html




Is there any other way in which we can achieve this is JSP ?
 
Bear Bibeault
Marshal
Posts: 67339
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've already been asked to use code tags once.
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!