File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Problem with xmlhttp.responseXML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem with xmlhttp.responseXML" Watch "Problem with xmlhttp.responseXML" New topic
Author

Problem with xmlhttp.responseXML

Ameya Thakur
Ranch Hand

Joined: Feb 04, 2004
Posts: 43
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Feb 04, 2004
Posts: 43
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

You've already been asked to use code tags once.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with xmlhttp.responseXML