Hi Thomas,

felix trunk contains the new http implementation which implements the
new OSGi Http Whiteboard Service implementation. And that one supports
the ServletContextListener. I suggest you read up the RFC 189 for that
specification; a draft spec from the OSGi alliance will hopefully be
available soon.

Regards
Carsten

Am 08.05.15 um 15:29 schrieb Thomas Driessen:
> Hi!
> 
> I'm currently trying to integrate Apache Shiro into my OSGi
> (Web-)Application which is built upon Apache Felix.
> According to the Shiro Setup Tutorial for normal Web Applications I have to
> add the following lines in my web.xml:
> 
> <listener>
>     
> <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class></listener>
> <filter>
>     <filter-name>ShiroFilter</filter-name>
>     
> <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class></filter>
> 
> and some entries for the filter-mapping.
> 
> As I'm working with felix.http and felix.whiteboard I thought, I could
> achieve the same result by registering the EnvironmentLoaderListener under
> the ServletContextListener Interface and the ShiroFilter under the Filter
> Interface via an Activator, like this:
> 
> public class DMActivator extends DependencyActivatorBase {
> 
> @Override
> public void destroy(BundleContext arg0, DependencyManager dm) throws
> Exception {}
> 
> @Override
> public void init(BundleContext arg0, DependencyManager dm) throws Exception
> {
> dm.add(createComponent()
> .setImplementation(EnvironmentLoaderListener.class)
> .setInterface(ServletContextListener.class.getName(), null));
> dm.add(createComponent()
> .setImplementation(ShiroFilter.class)
> .setInterface(Filter.class.getName(), null));
> }
> }
> 
> Unfortunately, the documentation of felix states, that
> ServletContextListener are not supported (but should be in the near future)
> by felix. Is there any other way I can add shiro to my webapp, that I'm not
> aware of? Is the documentation up-to-date or is the ServletContextListener
> maybe already added?
> 
> Any advice is appreciated :)
> 
> Thanks in advance for your help.
> 
> Best regards,
> Thomas
> 
> 


-- 
Carsten Ziegeler
Adobe Research Switzerland
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to