Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从grid extjs任务栏内的按钮调用servlet_Javascript_Ajax_Extjs - Fatal编程技术网

Javascript 从grid extjs任务栏内的按钮调用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,

我想在单击按钮后将文本字段数据发送到servlet。网格tbar中的文本字段和按钮。我使用Ajax请求调用servlet,但它没有调用它

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