Reputation: 8286
I am currently programming using Eclipse 3.4.1 and using the Apache 5.5 as backend server. I am also using the com.sysdeo.eclipse.tomcat_3.2.1 plugin for tomcat.
I was just wondering, when I encounter an error and prints the stack trace for the exception. I always would see the line code where the error occured on the java work file generated from JSP file. However, when I try to click on the link, it saids source not found for "org.apache.jsp.WResultReportList_jsp".
java.lang.NullPointerException
at org.apache.jsp.WResultReportList_jsp._jspService(WResultReportList_jsp.java:381)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
I was wondering how I could configure eclipse to be able to find that work file and open the specific line of code where the error occurred?
Is it even possible to point the error to the location of the actual JSP file? Or is it just able to find the error line number for the java generated work file?
Upvotes: 3
Views: 4747
Reputation: 1252
In order to find the java file generated by jsp simply write this code in jsp file and run your application and follow the path which will display after successfully run
<%=getClass().getResource(getClass().getSimpleName() + ".class")%>
I found this usefull. Hope this will work.
Upvotes: 1
Reputation: 7469
Project -> Properties -> Java Build Path -> Source -> Link source...
Linked folder location: C:\tomcat 7.0\work\Catalina\localhost\application_name
Press "Finish".
Upvotes: 5
Reputation: 55957
According to this documentation there is an Apache options to control whether the generated Java code is retained (the runtime needs only the class files). So you first should check whether the keepgenerated option is set to true (the documentation states that if it's not specified then the default is true).
After that a quick search for .java files should help you find them.
Upvotes: 1