Breakpoints not working on JSP pages in Eclipse

♀尐吖头ヾ 提交于 2019-12-02 20:06:51

问题


Breakpoints are being hit in the Java code, the project is being run as Debug, "Skip All Breakpoints" is disabled, line breakpoints (blue dots) are on lines in my JSP pages.

The result in the web browser debug, so I know it's hitting the right page:

Why are my breakpoints on JSP pages not being hit? I'm having no issue making changes and seeing them reflected in the browser. Eclipse 4.6.2. WebSphere 8.5

Edit: I'm not sure if this is related. When I try to start my server in Eclipse it says

Cannot connect to the server process. Make sure the server is already started.

to get it to start in Eclipse I have to double click the server and uncheck:

Start a server with a generated script


回答1:


Found a workaround. In the JSP, import a Java class and call one of it's methods. Put a breakpoint at the end of that method and step through it (F5) into the JSP.




回答2:


To get debug on a JSP you might need an additional step:

Open the appropriate server in the Servers view of the Server Perspective (Window > Open Perspective > Server), and ensure that the Generate debug information when compiling JSPs (debug mode only) check box is selected. Close the server editor.

This is described in this doc: Debugging JSP files



来源:https://stackoverflow.com/questions/53915010/breakpoints-not-working-on-jsp-pages-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!