Eclipse cannot find java file generated via jsp in working folder

I am currently programming Eclipse 3.4.1 and using Apache 5.5 as my backend server. I am also using the com.sysdeo.eclipse.tomcat_3.2.1 plugin for tomcat.

I'm just wondering when I ran into the error and will print out the stack trace for the exception. I've always seen the code for the line where the error occurred in the java working file generated from the JSP file. However, when I try to click the link, it said the source was 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 to configure eclipse to find this working file and open a 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 can it just find the error line number for the java generated working file?

+2


source to share


3 answers


Project -> Properties -> Java Build Path -> Source -> Link Source ...

Linked folder: C:\tomcat 7.0\work\Catalina\localhost\application_name



Click Finish.

+4


source


According to this documentation, there are Apache options to control whether the generated Java code is saved (the runtime only needs class files), so you first need to check if the keepgenerated parameter is set to true (the documentation states that if it is not specified, the default is true).



After that, a quick search for the .java files will help you find them.

+1


source


To find the java file generated by jsp just write this code in the jsp file and run the application and follow the path that will be displayed after successful launch

<%=getClass().getResource(getClass().getSimpleName() + ".class")%>

      

I found this helpful. Hope it works.

+1


source







All Articles