In Eclipse you can configure numerous servers to run inside the IDE, including Tomcat. Depending on your Tomcat configuration, at some point in the life cycle of a webapp your J
You can change it by setting scratchDir parameter in web.xml configuration of your server (in Servers project, not in your application web.xml!).
If you're using the Tomcat Maven Plugin in Eclipse, then your Tomcat related files would be in <project folder>/target/tomcat
instead, including the tomcat work folder at <project folder>/target/tomcat/work
, and you can descend from there to find your jsp .java files, etc.
(I know this may not apply to everyone, but since Tomcat Maven Plugin is a popular way to develop with tomcat and using maven to manage dependencies and help with the build process, I hope this info may be helpful for some people).
The easiest way is most likely to ask a compiled JSP page about the source of the byte code.
From http://www.exampledepot.com/egs/java.lang/ClassOrigin.html:
// Get the location of this class
Class cls = this.getClass();
ProtectionDomain pDomain = cls.getProtectionDomain();
CodeSource cSource = pDomain.getCodeSource();
URL loc = cSource.getLocation(); // file:/c:/almanac14/examples/
Hopefully this helps. What is it you want to do?
You will find it in
projectworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
This is the default place where Eclipse 3.4 publishes the project. However, this can be changed by changing the settings in your 'Server' view.
Go to "Servers" window -> double click on your tomcat instance -> clik "Open launch configuration" -> go to "Arguments" tab.
Look for variable definition like this:
-Dcatalina.base="/Users/dirtyaffairs/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0"
I assume it would be the same location relative to your workspace.