我有以下jsp页面。它正在显示结果。
enter code here
<%@page language="java" import="java.sql.*, java.util.*, java.lang.*, net.sf.json.*, org.json.simple.JSONObject" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/thermo?user=root&password=");
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery("select model_number from product");
JSONObject json = new JSONObject();
JSONArray addresses = new JSONArray();
//JSONObject address =new JSONObject();
while(result.next())
{
//address.put(result.getString("model_number"));
addresses.add(result.getString("model_number"));
}
json.put("Addresses", addresses);
out.println(addresses);
response.setContentType("application/json");
response.getWriter().write(json.toString());
}
catch (JSONException jse)
{
}
%>
and i have following js file.
I got the following Exception when i run the js file.
[WARN][Anonymous] [Ext.Loader] Synchronously loading 'Ext.dataview.List'; consider adding 'Ext.dataview.List' explicitly as a require of the corresponding class
:8080/Sample/sdk/src/log/writer/Console.js?_dc=1334137320671:35
[WARN][Anonymous] [Ext.Loader] 同步加载'Ext.data.proxy.JsonP';考虑明确添加“Ext.data.proxy.JsonP”作为相应类的要求
Uncaught SyntaxError: Unexpected token ::8080/new/modelnumber_list.jsp?_dc=1334137328213&page=1&start=0&limit=25&callback=Ext.data.JsonP.callback1:1
enter code here
`Ext.define('Sample.view.Blog',{
extend:'Ext.navigation.View',
xtype:'bloglist',
config:{
title:'Blog',
iconCls:'star',
scrollable:true,
styleHtmlContent: true,
items:{
xtype: 'list',
itemTpl: '{model_number}',
store:{
autoLoad: true,
fields: ['model_number'],
proxy:{
type: 'jsonp',
url: 'modelnumber_list.jsp',
reader:{
type: 'json',
rootProperty: 'root'
}
}
}
}
}
});
Thank you.