我正在使用 ext.data.store 在 extjs 4.0 中实现自动完成组合框
var RecordDef = Ext.data.Record.create([
{name: 'description', mapping: 'description'},
{name: 'lat'},
{name: 'lng'}
]);
var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'geo-multi.xml'}),
headers: {
'Content-Type': 'application/xml'
},
reader: new Ext.data.XmlReader({
totalRecords: 'count',
record: 'result'
}, RecordDef)
});
问题是在检查 firebug 后接收 text/html 作为响应类型标头:
Connection Keep-Alive
Content-Length 409
Content-Type text/html;charset=UTF-8
Date Sat, 07 Apr 2012 13:59:33 GMT
Last-Modified Sun, 08 Jan 2012 08:11:37 GMT
Server Winstone Servlet Engine v0.9.10
谁能帮我将正确的内容类型标题设置为 text/xml ?