Uploaded image for project: 'Pax Web'
  1. Pax Web
  2. PAXWEB-349

Service properties are not filtered before being set as init parameters

    Details

      Description

      When registering a javax.servlet.Servlet osgi service, the whiteboard extender picks this up and passes ALL the service properties to pax web as init parameters. This should be filtered in some way as it causes problems in some legacy servlets that do automatic processing of all their init params.

      See the OSGI Alliance community wiki page on Http Whiteboard implementations http://wiki.osgi.org/wiki/WebExperience which notes how the Felix whiteboard extender only passes service properties prefixed with "init." as init params.

      I'm not sure what kind of fix you would want to implement and I'm not 100% sure where, but it looks like this is the location where a fix should be applied.
      https://github.com/ops4j/org.ops4j.pax.web/blob/web-1.1.0/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/ServletTracker.java

      Some options are:
      2) filter the service properties for keys starting with "init." before passing them on as init params. this would be in line with Felix
      3) introduce another property (i.e., "init-prefix") that would contain a prefix value for filtering the other service properties.

        Attachments

          Activity

            People

            • Assignee:
              achim_nierbeck Achim Nierbeck
              Reporter:
              random18237 J
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: