CDI Ambiguous dependencies

后端 未结 4 896
孤城傲影
孤城傲影 2021-02-19 11:11

I have a @SessionScoped @Named bean with a @Producer method for a user object:

@Named @SessionScoped
public class UserBean implements S         


        
4条回答
  •  迷失自我
    2021-02-19 11:33

    I'm not an expert but I had a similar problem, and I fixed it in simpler way, by annotating the bean itself with @Alternative, so that the Producer is favored. Could be I'm missing some side effects but this worked as far as I could see / needed.

提交回复
热议问题