Ich habe folgende JSP-Seite. Und es zeigt das Ergebnis.Ich die Daten aus DB mit JSP abrufen und ich möchte diese Datenliste in Senchatouch2 anzeigen?
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/Autor/Console.js _DC = 1334137320671: 35
[Warnen] [Anonymous] [Ext.Loader] Synchrone Laden ‚Ext.data .proxy.JsonP '; 'Ext.data.proxy.JsonP' ausdrücklich als erforderlich der entsprechenden Klasse prüfen, indem
Uncaught Syntaxerror: unerwartetes Token :: 8080/neu/modelnumber_list.jsp _DC = 1334137328213 & page = 1 & start = 0 & limit = 25 & Rückruf = 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.
[WARN] [Anonymous] [Ext.Loader] Synchrones Laden von 'Ext.dataview.List'; betrachten ausdrücklich als erforderlich der entsprechenden Klasse nicht erfasste Fehler ‚Ext.dataview.List‘ und fügte hinzu: [Ext.createByAlias] Kann keine Instanz unerkannt Alias erstellen: proxy.json Sencha-touch.js: 6366 – sirisha
, wenn ich gebraucht Der obige Code in meinem Programm habe ich den obigen Fehler. – sirisha