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;
}
}
精彩评论