On Mon, Jun 28, 2004 at 08:57:49AM -0700, Woodchuck wrote:
: under the <web-app> section of the web.xml file, can we arbitrarily
: reference other xml files?
: that is, if i put all my <servlet> tags in one file (my_servlets.xml)
: and all my <servlet-mapping> tags in another file (my_mappings.xml), is
: it possible to reference these from the web.xml file (and not upset
: tomcat in doing so)?
Yes and no: you can call external entity references (which, in turn,
point to files) from your web.xml; but as there is no guarantee of what
is a webapp's "current directory" you'd have to hardcode those paths.
That would make your app less portable between containers and perhaps
even different Tomcat revs.
You could merge your files of <servlet> and <servlet-mapping> tags at
build time. For example, I use the Ant tasks <loadfile> and <copy> +
<filter>. If you're interested, I'll post that in detail.
: also, i was experimenting and discovered i could place <servlet> tags
: and <servlet-mapping> tags in different orders (within <web-app>
: section) and it still works!
What servlet spec do you specify in your web.xml?
IIRC 2.4's schema permits a more logical order, such as
<servlet>
<servlet-mapping>
<servlet>
<servlet-mapping>
-but don't quote me on that, as I don't have the spec in front of me
right now.
-QM
--
software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]