Hi Alexander,

just from the top of my head, have you tried if you use the whiteboard
pattern.
Though that might not work either cause you somehow need to share the
http-context.
Maybe you can use the http-context as a service, and are able to share it
this way between
different bundles?

regards, Achim

2012/2/2 Alexander Krauss <alexander.kra...@qaware.de>

> Dear list,
>
> I am using Pax Web to publish a servlets, with some filters. However,
> it seems that a filter is only applied to
> servlets from the same bundle. While I can understand the rationale
> behind this, I wonder if there is a way around it.
>
> Here is theSpring configuration that I currently use to publish the
> servlet and filter:
>
> In Bundle A:
>
>  <osgi:service ref="myServlet">
>        <osgi:interfaces>
>            <value>javax.servlet.Servlet</value>
>        </osgi:interfaces>
>        <osgi:service-properties>
>            <entry key="alias" value="/foo"/>
>            <entry key="matchOnUriPrefix" value="true"/>
>            <entry key="servlet-name" value="MyServlet"/>
>        </osgi:service-properties>
>    </osgi:service>
>
>
> In Bundle B:
>
>    <osgi:service ref="myFilter">
>        <osgi:interfaces>
>            <value>javax.servlet.Filter</value>
>        </osgi:interfaces>
>        <osgi:service-properties>
>            <entry key="urlPatterns" value="/*"/>
>            <entry key="matchOnUriPrefix" value="true"/>
>            <entry key="servletNames" value="MyServlet"/>
>        </osgi:service-properties>
>    </osgi:service>
>
>    <osgi:service ref="myOtherServlet">
>        <osgi:interfaces>
>            <value>javax.servlet.Servlet</value>
>        </osgi:interfaces>
>        <osgi:service-properties>
>            <entry key="alias" value="/bar"/>
>            <entry key="matchOnUriPrefix" value="true"/>
>            <entry key="servlet-name" value="MyOtherServlet"/>
>        </osgi:service-properties>
>    </osgi:service>
>
>
> What I observe is that the filter is in effect for myOtherServlet, but
> not myServlet.
> Is there a way of getting it applied to myServlet as well?
>
> I am using Karaf 2.2.4, which comes with Pax Web 1.0.7.
>
> Thanks,
> Alex
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to