It doesn't work that way, check once again Hernán's mail, he showed
you interceptor, annotation and how to define a stack. You just must
add annotation into your action.

2013/3/20 Omar Ngarigari <ngarigar...@yahoo.com>:
> I annotated my action class as follow:
>
> @Target({java.lang.annotation.ElementType.METHOD})
> @Retention(RetentionPolicy.RUNTIME)
> public @interface SpringSecurityPrincipal {
>     public String getUsername();
> }
>
> in my action class
>
> public class AddAction extends ActionSupport implements 
> ModelDriven<AddCustomer>{
>
> private String username;
>
> @SpringSecurityPrincipal (getUsername = "username")
> public void setUsername(String username){
> this.username = username;
> }
>
> public String getUsername(){
> return username;
> }
>
> JSP
> <s:textfield name="addCustomer.username" value="%{username}/>
>
> I debug my SpringSecurityPrincipal class is returning null, and the username 
> does not display in JPS.

Absolutely wrong, interceptor will look for method annotated with
@SpringSecurityPrincipal (you did it wrong), and then call that method
with parameter User, so you must have a setter setUser(User user) in
your action. Then you can call it from jsp <s:property
value="user.username"/> (you need a getter)


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

Reply via email to