简体   繁体   English

无法在NetBeans上使用JQuery ajax调用调试Java Servlet

[英]Can't debug Java Servlet using JQuery ajax call on NetBeans

I'm trying to debug my JAVA project. 我正在尝试调试我的JAVA项目。 During which, I'm trying to call a JAVA servlet (running on Apache Tomcat) using JQuery's ajax function. 在此期间,我试图使用JQuery的ajax函数调用JAVA servlet(在Apache Tomcat上运行)。 However, although I ran the JAVA project in debug mode, I'm unable to access the servlet's ProcessRequest function in Debug mode. 但是,尽管我在调试模式下运行了JAVA项目,但无法在调试模式下访问Servlet的ProcessRequest函数。 I've checked the javascript code, and I do seem to get to the line where the AJAX call is being made, so I'm guessing there's something I'm missing on the IDE side. 我已经检查了javascript代码,似乎确实到达了进行AJAX调用的行,因此我猜测IDE端缺少某些内容。

Nothing happens on both the JSP and both the JAVA Servlet itself on the IDE side (Using Netbeans 7.2). 在IDE端,JSP和JAVA Servlet本身均未发生任何事情(使用Netbeans 7.2)。

Is there any special thing I need to enable when debugging AJAX calls? 调试AJAX调用时是否需要启用任何特殊功能?

Is there anything I need to setup in the Tomcat side? 我需要在Tomcat端进行设置吗?

You have to debug in the listener that receives the AJAX request. 您必须在接收AJAX请求的侦听器中进行调试。

The JSP or servlet doesn't know or care anything about AJAX; JSP或servlet不了解或不关心AJAX。 it's just another HTTP request as far as it's concerned. 就它而言,这只是另一个HTTP请求。

So if you're sure the call is being made, I'd say that you need to look at your debugging arrangement. 因此,如果您确定正在拨打电话,我想您需要看一下调试的安排。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM