Debugging JSP through eclipse

date published : February 01, 2009 read time : 3 mins

For many of us, it’s a pain debugging a UI, especially a JSP page without any special add-ons in eclipse. And here is a simple solution for it.

  • Create a class named Test and a public method foo() in that.
  • Now put a breakpoint in the entry of the foo() method.
  • Insert foo() invocation in the JSP just before the point where you want to start the debugging. For Eg. <% Test.foo()%>
  • Start the debugger in eclipse.
  • Now once you execute your flow, the debugger will suspend the thread at the entry of foo()
  • Press F7 and guess what you will be taken to the JSP page from where you can continue the debugging in the JSP itself