Which annotation type should I use in my actiom class to inject user object?
Sent from my iPhone On Mar 20, 2013, at 2:14 AM, Lukasz Lenart <lukaszlen...@apache.org> wrote: > 2013/3/20 Omar Ngarigari <ngarigar...@yahoo.com>: >> <s:textfield name="addCustomer.postUserId" >> value="%{springSecurity.currentUser}"/> > > You cannot call interceptor directly, it must be an action. > >> while (((actionClass = actionClass.getSuperclass()) != null) && >> (!isDone)) >> { >> for (Method method : actionClass.getDeclaredMethods()) >> { >> if >> ((method.getAnnotation(SpringSecurityPrincipal.class) != null) && >> ((currentUser.getPrincipal() instanceof User))) { >> method.invoke(action, new Object[] { >> currentUser.getPrincipal() }); > > This part is looking for a method annotated with the below > @SpringSecurityPrincipal and if it will find it, inject User object. > >> public @interface SpringSecurityPrincipal > > You must annotate action's method to allow inject User object > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org