0

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 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?

1 Answers1

0

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;
    }

}
baraber
  • 3,296
  • 27
  • 46