Results 1 to 4 of 4

Thread: Content-type problem for XML in Explorer....

  1. #1

    Default Content-type problem for XML in Explorer....

    Hi my friends,

    Sorry for bothering again but i still couldn't solve my problem.
    I am trying to read an XML file into a datastore and then show it in a html div element. It works fine in firefox or chrome but unfortunately it doesnt work in Explorer.
    In everywhere, it is written that explorer cannot notice the content-type of file is xml and i need to set it manually into html response. But i really couldn't understand how to make it. Because the xml file is not producing by the server, it is just a static xml file on disk. So i need your advice so much.....Here is my code:

    Code:
    var submenuReader = new Ext.data.XmlReader({
         	        record: 'Menu',
         	        id: '@name',
         	        fields: [
         	            {name: 'Name', mapping: '@name'},
         	            {name: 'Url', mapping: '@url'},
         	            {name: 'Menu', mapping: '/'}
         	        ]
         	    });
    
         	    var dataStore = new Ext.data.Store({
         	        proxy: new Ext.data.HttpProxy({
         	            url: 'menu.xml',
         	            method:'get',
         	  	    headers: {"Content-Type": "text/xml; charset=utf-8"}
         	        }),
         	        reader: new Ext.data.XmlReader({
         	            record: 'Item',
         	            id: 'MenuGroup',
         	            fields: [
         	                'MenuGroup',
         	                {name: 'Submenus', convert: function(v, n){
         	                    return submenuReader.readRecords(n).records;
         	                }}
         	            ]
         	        })
         	    });
    
    
         	    dataStore.on('load', function (store, records, options) {
         	        var tpl = new Ext.XTemplate(
         	                '<tpl for=".">',
         	                    '<a href="#">{values.data.MenuGroup}</a>',
         	                    '<tpl for="values.data.Submenus">',
         	                    	'<a href="{values.data.Url}">{values.data.Name}</a>',
         	                    '</tpl>',
         	                '</tpl>'
         	        );
         	       tpl.overwrite(Ext.get("menu"), dataStore.getRange());
         	    });
         	    
         	   dataStore.load();

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    No, don't set the content-type in the request header. It needs to be set in the response header.

    Which HTTP server are you using? Apache? In that case you should configure the response header for *.xml files in the httpd.conf file (but it should already default to text/xml).

  3. #3

    Default

    i am using weblogic 11g

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    I have no experience with WebLogic, but a quick Google turned up:

    Add to web.xml:
    Code:
    <mime-mapping>
      <extension>xml</extension>
      <mime-type>text/xml</mime-type>
    </mime-mapping>

Similar Threads

  1. XML rendering problem in Flash componenet using Portal and Content Panel
    By sathishb in forum Ext GWT: User Extensions and Plugins
    Replies: 0
    Last Post: 10 Nov 2010, 7:06 AM
  2. AJAX form post content type problem
    By kolaloka in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 2 Feb 2010, 5:00 AM
  3. Ajax, XML, POST and PUT, Content Type
    By tellioglu in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 4 Apr 2008, 1:12 PM
  4. Problem with grid with Content-Type application/xhtml+xml
    By Cavalier in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 1 Apr 2007, 4:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •