8 months ago

這樣的注入方式 Spring 已經不推薦了

@Autowired
private UserRep mainUserRep;

可以參考這篇來配置
http://pppurple.hatenablog.com/entry/2016/12/29/233141

最神奇的是 搭配 lombok 下面這樣就完成注入配置了

@RequiredArgsConstructor
@Component
public class ApplicationLoader {
    @NonNull
    private UserRep mainUserRep;
}
← SpringBoot + Thymeleaf + Vue 範例 use JWT OAuth2 and spring-security Create AuthorizationServer →
 
comments powered by Disqus