jetty-web.xml use

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

jetty-web.xml use

Nic James Ferrier
I'm using Jetty 6.1.3 on java 1.5 on debian.


I've got a webapp which defines an extensive list of configuration in
it's web.xml.

The configuration needs to be overridden for practically every
environment it runs in (because of things like SQL server locations
and so on).

I thought the RIGHT way to do this would be to have Jetty load the
webapp from the webapps directory but to put a jetty-web.xml into the
WEB-INF of said webapp specifying the location of the override file;
so something like this:

  <?xml version="1.0"  encoding="ISO-8859-1"?>
  <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
  <Configure class="org.mortbay.jetty.webapp.WebAppContext">

      <Call class="org.mortbay.log.Log" name="warn"><Arg>executing jetty-web.xml</Arg></Call>
      <Set name="overrideDescriptor"><SystemProperty name="jetty.home" default="."/>/locationspecific.xml</Set>
  </Configure>

locationspecific.xml could then define the config for the specific
locations.


But it doesn't work.

It doesn't work because the config is not applied before the previous
config is executed.


So what's the best way to load a webapp and specify an override
web.xml?

--
Nic Ferrier
http://www.tapsellferrier.co.uk   

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: jetty-web.xml use

jan_bartel
Nic,

You could use the ContextDeployer to deploy your webapp - take
a look at the test.xml example in $JETTY-HOME/contexts/ for using
an override web.xml descriptor.

cheers
Jan

Nic James Ferrier wrote:

> I'm using Jetty 6.1.3 on java 1.5 on debian.
>
>
> I've got a webapp which defines an extensive list of configuration in
> it's web.xml.
>
> The configuration needs to be overridden for practically every
> environment it runs in (because of things like SQL server locations
> and so on).
>
> I thought the RIGHT way to do this would be to have Jetty load the
> webapp from the webapps directory but to put a jetty-web.xml into the
> WEB-INF of said webapp specifying the location of the override file;
> so something like this:
>
>   <?xml version="1.0"  encoding="ISO-8859-1"?>
>   <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
>   <Configure class="org.mortbay.jetty.webapp.WebAppContext">
>
>       <Call class="org.mortbay.log.Log" name="warn"><Arg>executing jetty-web.xml</Arg></Call>
>       <Set name="overrideDescriptor"><SystemProperty name="jetty.home" default="."/>/locationspecific.xml</Set>
>   </Configure>
>
> locationspecific.xml could then define the config for the specific
> locations.
>
>
> But it doesn't work.
>
> It doesn't work because the config is not applied before the previous
> config is executed.
>
>
> So what's the best way to load a webapp and specify an override
> web.xml?
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support