问题
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