Wayne Beaton explains how Java Server Pages (JSPs) can be debugged using the Eclipse WebTools platform. Having a bunch of Java code in your JSP files is a godsend, contrary to popular belief.
“With WebTools installed, you can add one or more breakpoints by opening an editor on the JSP file, and double-clicking in the left-hand column. A breakpoint icon will then appear,” he says.
Right-clicking in the JSP editor or on the JSP file in the package explorer and selecting “Debug As > Debug on Server”, or clicking the “Start in Debug Mode” icon on the Servers view will start the server in debug mode. “When execution reaches the breakpoint, Eclipse will drop you into the Debug perspective where you can hop, skip, jump, and inspect variables to your heart's content,” Wayne explains.