资 源 简 介
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 extends ActionBean> type,
ActionBeanContext context) throws Exception
{
return injector.getInstance(type);
}
}
```
Then you can go ahead and wire the whole t