Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Option for Setting Context Params in Deployer Descriptors

Chad,

you can set context init parameters from a context.xml file with something like:


   <Get name=ServletContext>
     <Call name=setInitParameter>
       <Arg>name</Arg>
       <Arg>value</Arg>
    </Call>
  </Get>

But the problem with this style is that the real web.xml will be run
after the context.xml and may replace values that you set.
So that is why override descriptors are provides, so that they can be
set after the web.xml

cheers


On 4 December 2010 13:05, Chad La Joie <lajoie@xxxxxxxxx> wrote:
> I had asked on the user's list regarding the possibility of setting Servlet
> context parameters within the a deployment descriptor.  I didn't receive an
> answer so I went looking at the code and it seems like this is not possible.
>  At least, I didn't see anything in the WebAppContext class or its super
> types.  The closest thing appeared to be the ability to specify a special
> web.xml file that would be merged with the one in the WAR.
>
> A lot of web apps use context parameters to specify things that would change
> per-deployment (e.g., configuration files).  Having to break open a WAR file
> (assuming its zipped up) to change such information is annoying (and
> honestly beyond the means of some novice deployers).
>
> So, my suggestion is to allow people to specify Servlet context params
> within a context deployment descriptor.
>
> What do people think?
>
> --
> Chad La Joie
> http://itumi.biz
> trusted identities, delivered
> _______________________________________________
> jetty-dev mailing list
> jetty-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>


Back to the top