I am configuring the shiro-spring-starter.
@Configuration
public class ShiroConfig {
@Bean
public Realm realm() {
return new UserRealm();
}
}
\\Without @Component
public class UserRealm extends AuthorizingRealm {
@Autowired
private UserMapper userMapper;
}
UserRealm was create using "new UserRealm()",without @Component. why the @Autowired work?