开发者

How to customize seam 3 credentials?

is there any way to customize seam 3 credentials object?

I need to add one more attribute to credentials (captcha). I tryed the following code:

@Named("credentials") @SessionScoped
public class Credentials extends CredentialsImpl {

    private static final long serialVersionUID = -4377742708407292709L;

    private String captcha;

    public String getCaptcha() {
        return captcha;
    }

    public void开发者_Python百科 setCaptcha(String captcha) {
         this.captcha = captcha;
    }

}

But it has a conflict with org.jboss.seam.security.CredentialsImpl @Named annotation. How can i override the credentials?


Yould could try a CDI specialization. Ie :

@Alternative 
@Specializes 
@SessionScoped
public class Credentials extends CredentialsImpl {

    private static final long serialVersionUID = -4377742708407292709L;

    private String captcha;

    public String getCaptcha() {
        return captcha;
    }

    public void setCaptcha(String captcha) {
         this.captcha = captcha;
    }

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜