<?xml version="1.0" encoding="UTF-8"?> <web-app ...> <!-- all declarations in shiro.ini file --> <filter> <filter-name>ShiroFilter</filter-name> <filter-class> org.apache.shiro.web.servlet.IniShiroFilter </filter-class> </filter> <filter-mapping> <filter-name>ShiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ... </web-app>
Although this service is strictly non-standard (i.e. not defined in the OSGi specification), the implementation offered by Felix does run on all the OSGi R4.x frameworks, including Equinox etc.
Neil
[1] https://cwiki.apache.org/FELIX/apache-felix-http-service.html
On Monday, 16 January 2012 at 16:24, Cristiano Gavião wrote:
> Hi,
>
> I've found an interested example of using Apache Shiro with Vaadin:
>
> http://eneuwirt.de/2011/04/22/using-apache-shiro-to-secure-vaading-application/
> https://github.com/eneuwirt/vaadin-shiro-simple
>
> The trick is to setup servlet filter and servlet mapping for it...
>
> > <?xml version="1.0" encoding="UTF-8"?> <web-app ...> <!-- all declarations in shiro.ini file --> <filter> <filter-name>ShiroFilter</filter-name> <filter-class> org.apache.shiro.web.servlet.IniShiroFilter (http://web.servlet.IniShiroFilter) </filter-class> </filter> <filter-mapping> <filter-name>ShiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ... </web-app>
well, I'm ok with the non-standard thing, it is not a problem for me.
Indeed the equinox (the container that I'm using) has such extension too
in its org.eclipse.equinox.http.servlet package.
what I really want to now is to understand where should I create such
filters in the vaadin-osgi bundle activation procedure... :)
My guess is that it should be in HttpServiceTracker class. At the
addingService method and before the AppRegistration instantiation...:
> @Override
> public Object addingService(ServiceReference reference) {
> HttpService http = (HttpService) super.addingService(reference);
> AppRegistration config = new AppRegistration(http, factory,
> alias);
Am I right ?
cheers
Cristiano