次の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/サンプル/sdk/src/log/writer/Console.js?_dc=1334137320671:35
[警告][匿名] [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.