Hello Michael,
try to use stripes-guice(http://www.silvermindsoftware.com/stripesguice/)
and bind the interceptors in the guice module(s) using
bindInterceptor. I'm using guice based injection and interceptors
without any problems. Documentation is also great, so give it try and
don't mix it with stripes-guicer ;-)
Regards,
Richard

On Sun, May 24, 2009 at 9:00 AM, Michael Day <[email protected]> wrote:
> I'm trying to instantiate my ActionBeans through guice so that I can
> put @Transactional annotations on my event handler methods.  So far it
> seems to be my holy grail for transaction management in a web
> environment, but it is proving difficult to attain.  Has anyone
> successfully done this?
>
> I've identified two problems so far beyond those already identified by
> others on the mailing list (which were apparently solved by using an
> ActionResolver similar to the one I have included below).
>
> 1.) @Before/@After annotations are ignored, presumably because the
> BeforeAfterMethodInterceptor is not examining annotations on the
> proxied ActionBean's superclass(es).
>
> 2.) Numeric indexed properties (item[0], item[1], etc) are not being
> set on form submission.
>
> Other annotations may not be working either.  I have tested
> @UrlBinding and @ValidationMethod, so I can confirm that they appear
> to be working.
>
> Thanks,
> Michael Day
>
> -------------
>
> public class GuiceActionResolver extends NameBasedActionResolver {
>     private Injector injector;
>     private Set<Class<?>> addedProxies = new HashSet<Class<?>>();
>
>     public void init(Configuration configuration) throws Exception {
>         injector = GuiceInjectorHolder.getInjector();
>         super.init(configuration);
>     }
>
>     @Override
>     protected ActionBean makeNewActionBean(Class<? extends
> ActionBean> type, ActionBeanContext context)
>             throws Exception {
>
>         ActionBean proxiedActionBean = injector.getInstance(type);
>
>         if (!addedProxies.contains(proxiedActionBean.getClass())) {
>             super.addActionBean(proxiedActionBean.getClass());
>             addedProxies.add(proxiedActionBean.getClass());
>         }
>
>         return proxiedActionBean;
>        }
> }
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://www.creativitycat.com
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to