如何使用Eclipse调试servlet [英] How to debug servlet using Eclipse
问题描述
确保您使用 Eclipse for Java EE ,而不是用于标准Java的Eclipse。
一旦确保/升级,在servlet代码中放置断点通常的方式,并在调试模式下运行服务器。右键单击Eclipse中的服务器,然后选择调试而不是开始(或单击错误按钮,而不是服务器视图按钮面板上的绿色箭头)。然后使用您喜欢的web浏览器在servlet上启动一个HTTP请求。当具有断点的特定代码行即将执行时,Eclipse将打开并集中调试面板。
Have a servlet and it can run inside TomCat. However, I am not sure how to debug it inside Eclipse(Java Standard version). Any suggestions?
Ensure that you're using Eclipse for Java EE instead of Eclipse for standard Java.
Once ensured/upgraded, put breakpoints in the servlet code the usual way and run the server in debug modus. Rightclick the server in Eclipse and choose Debug instead of Start (or click the bug button instead of the green arrow on the button panel of the servers view). Then fire a HTTP request on the servlet using your favourite webbrowser. Eclipse will open and focus the debug panel when the particular code line with the breakpoint is about to be executed.
这篇关于如何使用Eclipse调试servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!