André Warnier schrieb am 10.06.2010 um 21:52 (+0200):

> Assuming that some rogue application or filter *requires*
> site-specific parameters in web.xml, normally like so :
> 
> ...
>    <init-param>
>         <param-name>parameter1</param-name>
>         <param-value>value1</param-value>
>     </init-param>
>    <init-param>
>         <param-name>parameter2</param-name>
>         <param-value>value2</param-value>
>     </init-param>
> 
>  etc..
> 
> Does there exist *any* way to put the actual values "value1",
> "value2", etc.. in some place *outside* the web.xml file, and
> *outside* the war that would be created for this application,
> and still allow the application, on startup, to read the values
> of these parameters "from web.xml" ?

XML entity references? You can define an external general parsed entity
(EGPE) and then reference it. Doesn't have to be well-formed; it is
enough for it to be well-balanced, just like the two <init-param>
nodes you've shown above.

<!ENTITY cust-init-params
  SYSTEM "/home/cust123/web.xml.d/params.xml" >

And then reference it using "&cust-init-params;".

It requires the parser used by Tomcat to expand entities. Don't know if
it is appropriately configured by default.
-- 
Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to