开发者

How to customize seam 3 credentials?

开发者 https://www.devze.com 2023-03-21 11:05 出处:网络
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:

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

精彩评论

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

关注公众号