Open genkio opened 8 years ago
Property based injection
@RestController public class PageController { @Autowired private NotificationService notificationService; }
Setter based injection
@RestController public class PageController { private NotificationService notificationService; @Autowired public void setNotificationService(NotificationService notificationService) { this.notificationService = notificationService; } }
Constructor based injection
public class PageController { private NotificationService notificationService; @Autowired public PageController(NotificationService notificationService) { this.notificationService = notificationService; } }
顶,才看到
Property based injection
Setter based injection
Constructor based injection