Where are the servlet source files for JSPs compiled in Tomcat?

JIA Java Italian Association

[JSP is first translated into servlet than compiled. So where are those servlet .java or .class files for JSP examples in Tomcat?]

They are located in the work directory of the TOMCAT_HOME, under a directory that is normally called localhost_<port>%20<context_name>.

The source for JSPs from the examples webapp should be something like localhost_8080%20examples.

[Alessandro A. Garbagnati adds:

And, if you want to get the java.io.File object corresponding to the physical path of that location, you can just get it from the application scope:

File workDir = (File)getServletContext().getAttribute("javax.servlet.context.tempdir");