本文整理汇总了Java中com.pampanet.sample.shiro.modules.ShiroAnnotationsModule类的典型用法代码示例。如果您正苦于以下问题:Java ShiroAnnotationsModule类的具体用法?Java ShiroAnnotationsModule怎么用?Java ShiroAnnotationsModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShiroAnnotationsModule类属于com.pampanet.sample.shiro.modules包,在下文中一共展示了ShiroAnnotationsModule类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureServlets
import com.pampanet.sample.shiro.modules.ShiroAnnotationsModule; //导入依赖的package包/类
@Override
protected void configureServlets() {
super.configureServlets();
//get the bootstrapping Properties file
install(new BootstrapPropertiesModule());
//Initialize Persistence JPA Unit of Work if present
//install(new MyUnitOfWorkModule());
//Initialize Apache Shiro if present
install(new BootstrapShiroModule(getServletContext()));
//This allows Shiro AOP Annotations http://shiro.apache.org/java-authorization-guide.html
install(new ShiroAnnotationsModule());
Map<String, String> params = new HashMap<String, String>();
params.put(PackagesResourceConfig.PROPERTY_PACKAGES, propertyPackages);
//if you had a Persistence Service like JPA Unit of Work you would need to add this PersistFilter also.
//filter("/*").through(PersistFilter.class);
//if you had a ShiroWebModule installed above you would need to add this GuiceShiroFilter also.
filter("/*").through(GuiceShiroFilter.class);
serve("/rest/*").with(GuiceContainer.class, params);
}
示例2: configureServlets
import com.pampanet.sample.shiro.modules.ShiroAnnotationsModule; //导入依赖的package包/类
@Override
protected void configureServlets() {
super.configureServlets();
log.info("Bootstrap Main Servlet");
// get the bootstrapping Properties file
install(new BootstrapPropertiesModule());
// Initialize Persistence JPA Unit of Work if present
// install(new MyUnitOfWorkModule());
// Initialize Apache Shiro if present
install(new BootstrapShiroModule(getServletContext()));
//This allows Shiro AOP Annotations http://shiro.apache.org/java-authorization-guide.html
install(new ShiroAnnotationsModule());
//This Module will try to bind all the classes under .rest packages
install(new BootstrapRestPackagesModule());
filter("/*").through(GuiceShiroFilter.class);
filter("/*").through(GuiceRestEasyFilterDispatcher.class);
}
示例3: getModules
import com.pampanet.sample.shiro.modules.ShiroAnnotationsModule; //导入依赖的package包/类
@Override
protected List<? extends Module> getModules(ServletContext context) {
logger.entry(context);
return Arrays.asList(new BootstrapPropertiesModule(), new RequestScopeModule(), new BootstrapShiroModule(context), new ShiroAnnotationsModule(),new BootstrapRestPackagesModule());
}