java - Spring service中怎么使用当前的service对象,Autowired不成功
伊谢尔伦
伊谢尔伦 2017-04-18 10:55:44
0
2
424

比如AuthServiceImpl下有getUser()和getPage()两个方法,在getPage中我要调用getUser()方法,使用

@Autowired(required = false)

private AuthService authService;

自动注入会报错,在getPage里面new一个AuthService对象也不可以。

像这种service中使用当前对象应该怎么注入?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

répondre à tous(2)
伊谢尔伦

this.getUser();

巴扎黑

S'il n'y a pas de problème avec la configuration, vous pouvez considérer le problème de version

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!