Where are compiled JSP Java (*__jsp.java) files?

The compiled JSP files are by default available in the /work folder of the Tomcat environment. There should be a subfolder Catalina which in turn has a subfolder representing the domain name which defaults to localhost. There in turn should be the project folder which in turn contains package hierarchy org.apache.jsp with therein the compiled JSP files.

Tomcat
 |-- backup
 |-- bin
 |-- conf
 |-- lib
 |-- logs
 |-- temp
 |-- webapps
 `-- work
      `-- Catalina
           `-- localhost
                `-- projectname
                     `-- org
                          `-- apache
                               `-- jsp
                                    |-- survey_jsp.class
                                    `-- survey_jsp.java    <--- here

Unrelated to the concrete problem, there should be a root cause part in the stacktrace of the JspException which usually contains more detail about the real root cause of the problem. Read a bit further in the stacktrace. By the way, do you know that putting raw Java code in JSP files is considered a bad practice? It makes problems harder to debug as you encounter now.


If the page did not compile you should find it somewhere below <tomcat>/work/*. The full path depends on you environment. If you can't find it there you should start your Tomcat in debug mode, it definitly keeps .java files failed to compile (Tomcat 7).


I am using Intellij to learn JavaEE and in order to view some features when jsp translating into servlet, I also have to find the file.

I didn't find it below <tomcat_home>/work/*. I finally find that the file is under the ~/.IntelliJIdea15/system/tomcat/ folder( tree structure showing from ~/.IntelliJIdea15/system/tomcat/)!

Name related to project name
 |-- conf
 |-- logs
 `-- work
      `-- Catalina
           `-- localhost
                `-- projectname and type
                     `-- org
                          `-- apache
                               `-- jsp
                                    |-- survey_jsp.class
                                    `-- survey_jsp.java    <--- here

If you still can't find it under Intellij's home folder, you may have to try using

find . | grep 'nameOfYourJsp_jsp.java'

in suitable parent folder.


adding one more scenario: with eclipse and tomcat to run Spring MVC: you should find the _jsp.java files in your workspace folder:

\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost[project Name]\org\apache\jsp\

also this is really based on your setting in tomcat: enter image description here