Dangit, I forgot a thought. 

I think what I was getting at was, if you want to inject shiro filters, 
ShiroWebModule is the way to do that.  And, you can certainly use 
guice-servlet JUST for shiro (via ShiroWebModule), and not for your 
other servlets or filters.

-Jared

On Thu 01 Mar 2012 06:08:48 PM CST, Jared Bunting wrote:
> I'm not sure that shiro-guice is doing what you want.  shiro-guice is
> not intended to work side-by-side with EnvironmentLoaderListener - it is
> an alternate way to initialize the shiro framework.  You can certainly
> use Les's suggestion and injectMembers to inject the shiro filters, but
> in that case there's not really any reason to use ShiroModule.
>
> If you're using guice-servlet, then your wiring is probably going to be
> significantly easier if you use ShiroWebModule.  On the other hand if
> you're not using guice-servlet, then injecting servlet-container-created
> objects is going to require finding them and calling injectMembers(). 
> ShiroModule isn't really going to help with this.
>
> -Jared
>
> On 03/01/2012 03:46 PM, dan wrote:
>> Hi Jered,
>>
>> Thanks, that makes sense.  
>>
>> The option of calling injectMembers() seems fine with me.  I'm using 1.2's
>> new EnvironmentLoaderListener feature for early initialization of Shiro. 
>> Then, a second listener kicks in which initializes guice and the rest of our
>> app.  I suppose that adding the injectMembers() to my extended ShiroModule
>> is the best place.  
>>
>> But here's probably a dumb question: how do I ask shiro for the list of
>> currently instantiated filters?  Is it exposed in an API?
>>
>> Thanks very much,
>> Dan
>>
>> --
>> View this message in context: 
>> http://shiro-user.582556.n2.nabble.com/Injecting-Shiro-from-Guice-tp7333315p7334228.html
>> Sent from the Shiro User mailing list archive at Nabble.com.
>


Reply via email to