In Netbeans, I created a new default web application project which had an index.jsp
. In Tools > Servers
I had already pointed Netbeans to the place I had extracted Tomcat (C:\apache-tomcat-7.0.42).
I ran the program, the browser opened and the index.jsp
file was displayed.
What I don't understand is, that the index.jsp
file was not automatically copied to the Tomcat folder and it still worked. I thought that for a file to work, it had to be copied to the C:\apache-tomcat-7.0.42\webapps\ROOT\WEB-INF
folder.
index.jsp
file without copying it to the Tomcat folder? C:\apache-tomcat-7.0.42
or is it creating a separate 'virtual' kind of an instance of the server and running it in the Netbeans/Eclipse workspace?First of all, you need to know that Tomcat has two configurable directories:
CATALINA_HOME
, the directory where you chose to install Tomcat. e. g. c:\Program Files\Apache Software Foundation\Tomcat 6.0
. Tomcat uses this variable to find its internal classes and libraries.
CATALINA_BASE
the directory of the configuration files and directories, such as the web application directories. If CATALINA_BASE
isn't set, it defaults to the value of CATALINA_HOME
. e. g. C:\Users\JVerstry\.netBeans\7.1.2\apache-tomcat-7.0.22.0_base
In NetBeans, you will see that in:
NetBeans copies the files to the Catalina Base directory for deploy. This directory is in the user profile directory.
In eclipse, you will see that in:
eclipse copies the files for deploy, by default, in the .metadata
directory of the workspace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With