在以下代码段中,当我为 @ManagedBean 指定特定名称时,不会注入 userService 和 authenticationService。但是,如果我只使用没有名称的@ManagedBean,则注入工作正常。任何的想法?
@Component
@ManagedBean(name="user") // the injection doesn't work
//@ManagedBean // the injection works
@SessionScoped
public class UserManagedBean implements Serializable {
// Spring User Service is injected...
@Autowired
UserService userService;
@Autowired
private AuthenticationService authenticationService;