简体   繁体   English

如何在特定于URL请求的Eclipse中调试Java WebApp?

[英]How to debug java webapp in eclipse specific to a URL request?

In my java application, I have hundreds of images and js files. 在我的Java应用程序中,我有数百个图像和js文件。 I want to debug my app (using Springframework ) specific to a image url request, running in tomcat 7. How to do that in Eclipse IDE? 我想调试我的应用程序(使用Springframework),该应用程序特定于在Tomcat 7中运行的图像URL请求。如何在Eclipse IDE中做到这一点?

Should I have to include code to compare the urls and set break point 我是否应该包含代码以比较url和设置断点

{ using javax.servlet.http.HttpServletRequest getRequestURL()} 

in the code? 在代码中?

Thanks in Advance! 提前致谢!

You need to follow these steps: 您需要按照以下步骤操作:

  1. In the tomcat bin folder add a debug.bat (for windows) or debug.sh (for OS X, Linux, etc.) with the following content (note that catalina.sh needs to be replaced with catalina.bat for windows): 在tomcat bin文件夹中,添加具有以下内容的debug.bat (对于Windows)或debug.sh (对于OS X,Linux等)(请注意,对于Windows, catalina.sh需要替换为catalina.bat ):

    \nset JPDA_ADDRESS=8001 设置JPDA_ADDRESS = 8001\nset JPDA_TRANSPORT=dt_socket 设置JPDA_TRANSPORT = dt_socket\ncatalina.sh jpda start catalina.sh jpda开始\n
  2. Start tomcat using this debug file instead of start file packaged with default installation 使用此debug文件而不是默认安装打包的start文件来启动tomcat

  3. From eclipse , go to Debug > Debug Configuration eclipse中 ,转到调试>调试配置

  4. Select Remote Java Application from the left side menu and click on the New 从左侧菜单中选择“ 远程Java应用程序 ”,然后单击“ 新建”。
  5. Add parameters at the left side panel like this: 像这样在左侧面板中添加参数: 在此处输入图片说明

  6. Click Apply and then Debug button. 单击应用 ,然后单击调试按钮。 This will attach eclipse debug to previously started tomcat process. 这会将eclipse调试附加到先前启动的tomcat进程。

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

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