Configuring Apache Shiro with Google Guice Servlet
问题 I'm starting to use Guice/Shiro instead of Spring/Spring Security. I have looked examples from Shiro site, and all configuration examples are made as INI-file examples. Is it possible to configure Shiro in plain Java, as Guice Servlets are meant to be configured? 回答1: Yes it is possible, but requires some glue code if you want Guice to create your Realms. Bind Realm implementation: bind(Realm.class).to(MyRealm.class).in(Singleton.class); Bind WebSecurityManager: @Provides @Singleton