Thus defined in your mail ... 2013/3/20 Omar Ngarigari <[email protected]>: > 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 <[email protected]> wrote: > >> 2013/3/20 Omar Ngarigari <[email protected]>: >>> <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: [email protected] >> For additional commands, e-mail: [email protected] >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

