Question

How do I get the stack traces coming from compiled JSPs to include line numbers from the actual JSP file, not the intermediate Servlet java file?

I am using Jetty 8. I am currently taking up the Jetty instance programmatically.

(I use Eclipse for coding if that is of interest regarding the line number support stuff, I don't quite get the JSR-45 SMAP logic - is it a "side car" file, or is this info put in the actual class files?)

Will debugging, breakpoints work, re. JSPs?

Was it helpful?

Solution

Update: June 2017

Jetty 9 no longer uses Glassfish JSP.

It uses Apache Jasper JSP, same rules apply as below.

Original Answer

Jetty uses the JspServlet from the Glassfish project to manage all of its JSP handling.

There are 3 init-parameters on the JspServlet (see ${jetty.home}/etc/webdefault.xml contents) that might help.

  • "keepgenerated" (boolean) true
  • "development" (boolean) true
  • "classdebuginfo" (boolean) true

Set all of these development time settings to true and you should see more information. As well as have the intermediate source file to reference. This generated source files contains a line of commented out jsp source, then the resulting java source file that you can also use to backreference which line of your jsp caused the exception.

Also note that the JspServlet from Glassfish also uses java.util.logging as its underlying logging infrastructure. To see all the nitty details of the JspUsage (including jsp line numbers) try setting up java.util.logging for the "org.apache.jasper" package space at the FINEST level.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top