Here is the stacktrace:
...
org.apache.jsp.showcustomer_jsp._jspService(showcustomer_jsp.java:128)
org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
This is what I do:
showcustomer_jsp.java
file (and it isn't exactly obvious to look in /var/run/tomcat-6/Catalina/localhost/_/org/apache/jsp
). .jsp
file for the whatever you found on line 128 in the _jsp.java
file. Please, is there a simpler way to do this?
我在Eclipse WTP FAQ上找到了这个页面 ,它解释了如何配置Eclipse,以便您可以单击stacktrace转到生成的java代码。
I don't think you can. The JSP file is compiled into a servlet, and is not run directly. As the exception is thrown from this servlet, the line you have in the stack trace is the one from the class. The original line in the JSP is lost at this point.
Usually it is best to avoid writing code or throwing exceptions from a jsp, and encapsulate your logic in servlets and JSP tags, and use JSTL for control flow (if, forEach, etc.)
I used to program in Lex and Yacc which would generate C code, and you could enable #line pre-processor directives for debugging. When something happened in generated c code, then the IDE was smart enough to open the corresponding lex or yacc file, and not the generated c code. Surly
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.