Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328885 - web overrides do not override
Summary: web overrides do not override
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 7.1.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 16:20 EDT by AngerClown CLA
Modified: 2010-10-28 02:15 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AngerClown CLA 2010-10-27 16:20:12 EDT
Build Identifier: 7.2.0.v20101020

Using a web-override.xml file no longer overrides any properties that have already been set.

I am using web overrides to change some settings in both the default and jsp servlets. init-parameters that are not set by default do get set, but parameters that do have default values are ignored. Examples would be setting dirAllowed to false in the default servlet or reloading to false in the jsp servlet.

The issue appears to have been introduced in the fix for 320073 (SVN commit 2145). The org.eclipse.jetty.servlet.Holder.HolderRegistration.setInitParameter() function now contains this code:
if (Holder.this.getInitParameter(name)!=null)
 return false;

In other words, if an init parameter is already set, don't change it. This completely breaks the override mechanism.

setInitParameter() should either revert to the way it was, or there should be some way to enable overwrites to existing properties. (In the current code base, the boolean return value from org.eclipse.jetty.servlet.api.Registration.setInitParameter() is never used.)

If this code is the same in Jetty 8, it probably isn't working there either.

Reproducible: Always

Steps to Reproduce:
1. Create a web-overrides.xml file with:
    <servlet-name>default</servlet-name>
    <init-param>
      <param-name>dirAllowed</param-name>
      <param-value>false</param-value>
    </init-param>
</servlet>

2. Start a webapp and notice that dirAllowed is still set to the default value of true.
Comment 1 Jan Bartel CLA 2010-10-27 22:22:24 EDT
Thanks for pointing that out!

Fixed in jetty-7 r 2423.

I'll leave this open until this fix is ported to jetty-8.

Jan
Comment 2 Jan Bartel CLA 2010-10-28 02:15:34 EDT
Fixed also in jetty-8.