Javascript 从grid extjs任务栏内的按钮调用servlet
我想在单击按钮后将文本字段数据发送到servlet。网格tbar中的文本字段和按钮。我使用Ajax请求调用servlet,但它没有调用它Javascript 从grid extjs任务栏内的按钮调用servlet,javascript,ajax,extjs,Javascript,Ajax,Extjs,我想在单击按钮后将文本字段数据发送到servlet。网格tbar中的文本字段和按钮。我使用Ajax请求调用servlet,但它没有调用它 tbar: [{ xtype: 'textfield', name: 'text' }, { text: 'Serach', scope: this, handler: function () { Ext.Ajax.request({ method: 'GET', loadMask: true,
tbar: [{
xtype: 'textfield',
name: 'text'
}, {
text: 'Serach',
scope: this,
handler: function () {
Ext.Ajax.request({
method: 'GET',
loadMask: true,
scope: this,
url: 'http://localhost:8080/sampleweb/AccessServlet',
success: function (response, request) {
Ext.MessageBox.alert('success', response.responseText);
},
failure: function (response, request) {
Ext.MessageBox.alert('failure', response.responseText);
},
params: {
firstname: text.getValue()
}
});
}
}]
您不需要输入AJAX请求。只需将AccessServlet作为URL
或/sampleweb/AccessServlet
正如其他人所建议的,浏览器的“网络”面板中有什么。
您在服务器控制台上看到了什么?
您可以在服务器上启用调试以查看请求的传入。您的服务器上是否打开了日志记录?如果是,您是否看到请求到达服务器?你的浏览器的网络面板上说发生了什么?也许从该字段加载值时出错了?不要调用
text.getValue()
-使用Ext.getCmp('that\u field\u id')。getValue()
?您能够调用servlet吗?我也面临同样的问题。无法通过Extjs调用servlet