I am working on a web application using the Eclipse Java IDE.
I am using Tomcat 6 as my servlet container.
The tools available for Java, inculding Eclipse, seem to lack debugging capabilities for web applicatons (as compared to Visual Studio for the .NET platform).
How can I debug my web app using Eclipse?
在调试模式下运行tomcat(Java选项-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
),然后在Eclipse中使用远程调试(调试配置->远程Java Aplication)并通过已配置的端口(例如本例中的8000)连接到服务器。
If you want to debug your web application, set breakpoints where desired and run Tomcat on debug mode. If you logged your exceptions or placed INFO
/ DEBUG
messages, you can view them on Console
(if ConsoleAppender
is used).
The essential thing is that your application runs on debug mode. For browser side debugging (as @Thomas said), there's tools like Chrome Debugger (for Google Chrome), Firebug (for Firefox) and Firebug Lite (for other browsers).
您可以在代码中添加断点,并以调试模式部署应用程序。
Eclipse has a console window where you can see the error messages generated. For the web there are an add ons or built on the browser like firebug for Firefox and Google-chrome developers-tools. Try too look on it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.