如何在Netbeans中调试Java Web应用程序? [英] How to debug Java Web Application in Netbeans?
问题描述
我尝试以相同的方式调试它,但不是工作。
我已经建立了一个index.html网页。该页面上有一个表单。用户提交表单后,请求转到一个servlet(如serv1)。 servlet已经被调用,但是它显示了意想不到的结果。
所以要调试它,我在servlet类(serv1)中放置一个断点,然后调试应用程序。 / p>
但是当我提交表单时,控件没有在断点处停止。我确定断点设置的行正在被调用。
有没有我失踪的东西?
================== EDITED ========================= ======================
是的,我以调试模式启动了服务器。我正在使用Apache Tomcat 6.0.20
你是如何以调试模式启动Web应用程序的?在我的机器上,我只需选择项目,点击调试顶层菜单,然后点击调试项目,选择一个服务器(GlassFish,WebLogic, Tomcat),如果需要,事情只是工作(我可以在Servlet中放置一个断点,执行停止在那里)。用所有提到的容器进行测试。
I have debug Java Desktop Applications various times in Netbeans but haven't debug Java Web Application ever.
I tried to debug it the same way, but it's not working.
I have made an index.html webpage. There is a "form" on that page. After a user submits the form, the request goes to a servlet (say serv1). The servlet has been called but it is showing unexpected results.
So to debug it, I put a breakpoint in the servlet class (serv1) and then debug the application.
But when I submitted the form, the control didn't stop at the breakpoint. I am sure that the line at which the breakpoint is set is being called.
Is there any thing I am missing?
==================EDITED===================================================
Yes, I had started the server in debug mode. I am using Apache Tomcat 6.0.20
How did you start your web application in debug mode? On my machine, I simply select the project, click on the Debug top menu, then Debug Project, select a Server (GlassFish, WebLogic, Tomcat) if required and things just work (I can place a breakpoint in a Servlet and the execution stops there). Tested with all the mentioned containers.
这篇关于如何在Netbeans中调试Java Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!