首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 条纹Guice集成

条纹Guice集成

  • 资源大小:1.20 MB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: guice 集成 条纹

资 源 简 介

Overview This is an alternative to stripes-guicer. I think this approach is a bit simpler. It allows you to configure the web app using Guice"s ServletModule, and yet still use Stripes Dispatcher. You can use Guice"s @Inject annotations to inject services into ActionBeans. It just takes a custom NameBasedActionResolver to delegate to Guice for creating action beans. ``` public class ActionBeanGuicer extends NameBasedActionResolver { Injector injector; @Override public void init(Configuration configuration) throws Exception { injector = (Injector)configuration.getServletContext().getAttribute(Injector.class.getName()); super.init(configuration); } protected ActionBean makeNewActionBean(Class type, ActionBeanContext context) throws Exception { return injector.getInstance(type); } } ``` Then you can go ahead and wire the whole t

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP