Issue
When you run Tomcat from Eclipse, there are up to three webapps directories:
- $CATALINA_BASE/webapps, i.e., Eclipse's webapps, e.g.,
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps - wtpwebapps, e.g.,
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps - The webapps in the "Tomcat installation directory" ($CATALINA_HOME)
Can someone summarize the difference between them? In particular, in which webapps directory does Tomcat look for war files and web pages?
(Also see this similar question about conf directories.)
Solution
Short answer: Tomcat loads webapps from #1 and #2, but not #3.
Longer answer:
- Tomcat treats
$CATALINA_BASE/webappsas its webapps directory. It will expand any war file placed in this directory (if configured to expand wars). - People usually say that
wtpwebappsis the staging directory used by Eclipse. But the contents of this directory are never copied towebapps, rather, Eclipse tells Tomcat to load certain apps fromwtpwebapps. For example, if in Eclipse you add a project called "MyProject" to Tomcat, the file$CATALINA_BASE/conf/server.xmlwill include a line like this:
<Context docBase="/path/to/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/MyProject" path="/MyProject" ... >
- When run in Eclipse, Tomcat completely ignores the
$CATALINA_HOME/webappsdirectory.
Answered By - Dan R.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.