本文整理汇总了Java中org.apache.shiro.guice.web.ShiroWebModule类的典型用法代码示例。如果您正苦于以下问题:Java ShiroWebModule类的具体用法?Java ShiroWebModule怎么用?Java ShiroWebModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShiroWebModule类属于org.apache.shiro.guice.web包,在下文中一共展示了ShiroWebModule类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureShiroWeb
import org.apache.shiro.guice.web.ShiroWebModule; //导入依赖的package包/类
@Override
protected void configureShiroWeb() {
bindRealm().to(ClothoRealm.class);
//bindRealm().to(OAuthRealm.class);
bind(ServletContextHandler.class).annotatedWith(Names.named("containerServletContext")).toInstance(handler);
expose(ServletContextHandler.class).annotatedWith(Names.named("containerServletContext"));
ShiroWebModule.bindGuiceFilter(binder());
bind(CacheManager.class).to(MemoryConstrainedCacheManager.class);
}
示例2: configureServlets
import org.apache.shiro.guice.web.ShiroWebModule; //导入依赖的package包/类
protected void configureServlets() {
install( new GuicyFigModule( ChopUiFig.class, Project.class, RestFig.class, ElasticSearchFig.class ) );
install( new AmazonModule() );
// Hook Jersey into Guice Servlet
bind( GuiceContainer.class );
bind( IElasticSearchClient.class ).to( ElasticSearchClient.class );
// Hook Jackson into Jersey as the POJO <-> JSON mapper
bind( JacksonJsonProvider.class ).asEagerSingleton();
bind( UploadResource.class ).asEagerSingleton();
bind( RunManagerResource.class ).asEagerSingleton();
bind( TestGetResource.class ).asEagerSingleton();
bind( AuthResource.class ).asEagerSingleton();
bind( PropertiesResource.class ).asEagerSingleton();
bind( RunnerCoordinator.class ).asEagerSingleton();
ShiroWebModule.bindGuiceFilter( binder() );
// This should be before "/*" otherwise the vaadin servlet will not work
serve( "/VAADIN*" ).with( VaadinServlet.class );
Map<String, String> params = new HashMap<String, String>();
params.put( PACKAGES_KEY, getClass().getPackage().toString() );
serve( "/*" ).with( GuiceContainer.class, params );
}
示例3: configureServlets
import org.apache.shiro.guice.web.ShiroWebModule; //导入依赖的package包/类
@Override
protected void configureServlets() {
ShiroWebModule.bindGuiceFilter(binder());
bind( KafkaWebSocketCreator.class ).in(Singleton.class);
bind( HttpServletDispatcher.class ).in(Singleton.class);
serve( "/rest/*").with(HttpServletDispatcher.class);
bind( KafkaMessageSenderServlet.class ).in(Singleton.class);
serve( "/ws/*").with(KafkaMessageSenderServlet.class );
bind( LoginServlet.class).in(Singleton.class);
serve( "/login" ).with( LoginServlet.class );
bind( LogoutServlet.class).in(Singleton.class);
serve( "/logout" ).with( LogoutServlet.class );
}