J
joe
I'm having trouble really grokking the way Tomcat handles deployment of
webapps. It seems that there are two ways to define your webapps.
First, in server.xml, I can make Context elements inside of my Host
elements. There, I can specify the url path to tie into, the docBase,
the workDir, whether it's reloadable, and, I think, whether to
autoDeploy wars.
Or, I've found that I can just put my webapps (with a web.xml in the
WEB-INF dir) in Tomcat's default webapps directory and they get
automatically deployed to a url path matching the directory.
Are these two pretty much interchangeable, or should I almost always be
using one of these and, in rare cases, using the other?
What are the benefits and shortcomings of each one? For example, I know
that the server.xml Context element lets me specify reloadable=true
(something I want when doing development and need to test changes
without having to restart the server). Can the web.xml method do this?
Also, do either of these methods (or a combination of them) allow me to
load my JSPs and/or other resources (like jpegs, stylesheets, etc) from
one path, while getting the servlet classes and libs (ie, all of the
stuff from WEB-INF) from another path? (Yes, I know I could probably
use symbolic links. I'd like to do it differently).
Thanks in advance....
- Joe
webapps. It seems that there are two ways to define your webapps.
First, in server.xml, I can make Context elements inside of my Host
elements. There, I can specify the url path to tie into, the docBase,
the workDir, whether it's reloadable, and, I think, whether to
autoDeploy wars.
Or, I've found that I can just put my webapps (with a web.xml in the
WEB-INF dir) in Tomcat's default webapps directory and they get
automatically deployed to a url path matching the directory.
Are these two pretty much interchangeable, or should I almost always be
using one of these and, in rare cases, using the other?
What are the benefits and shortcomings of each one? For example, I know
that the server.xml Context element lets me specify reloadable=true
(something I want when doing development and need to test changes
without having to restart the server). Can the web.xml method do this?
Also, do either of these methods (or a combination of them) allow me to
load my JSPs and/or other resources (like jpegs, stylesheets, etc) from
one path, while getting the servlet classes and libs (ie, all of the
stuff from WEB-INF) from another path? (Yes, I know I could probably
use symbolic links. I'd like to do it differently).
Thanks in advance....
- Joe