Well, you have two options. The first is to use ShiroWebModule. While you may not be using guice for UI, it sounds like you do want to use it for a web component, which is exactly what ShiroWebModule is for. Without that, guice is not instantiating your filters, and guice can't inject what it doesn't know about.
If you don't want to do that, you can tell guice about your filter by passing it to injector.injectMembers() . -Jared On Thu 01 Mar 2012 11:25:11 AM CST, dan wrote: > Hi -- > > I'm just upgrading to Shiro 1.2 and trying to hook it into our Guice layer. > > Based on the instructions (http://shiro.apache.org/guice.html), I added a > module which extends from ShiroModule just like the example. (I'm not using > ShiroWebModule because we don't use guice for UI.) > > I would like for guice injection to work on my app's filters. For example, > I have tried adding > @Inject > ISharedMemoryDAO sharedMemoryDAO; > > to a filter but it is not injected by guice on startup. > > Is there something I have to add to my module class to tell guice to inject > these application-specific shiro filters? > > (This system also does not use AOP.) > > Dan > > > -- > View this message in context: > http://shiro-user.582556.n2.nabble.com/Injecting-Shiro-from-Guice-tp7333315p7333315.html > Sent from the Shiro User mailing list archive at Nabble.com.
