Spring Framework 4 Dependency Injection Tutorial Part I using Java Configuration and Annotations

preview_player
Показать описание
Spring dependency injection example - Part I of a tutorial showing how to use dependency injection (also called Inversion of Control or IoC) in Spring Framework 4 using Java configuration and annotations - with real life examples.

This is a preview video of my Spring 4 tutorial - a complete course for getting started with Spring Framework 4, Spring MVC, Spring AOP, Spring Task Execution and Scheduling etc. using latest Spring projects like Spring Boot, Spring Data JPA, Spring Security, using annotation and Java configuration based dependency injection.

The complete course is a spring tutorial for beginners, with examples. Learn starting from how to create new project using spring tool suite (STS), Eclipse or any IDE using Maven up to developing a production grade user module including user signup, login, verify email, forgot password etc.

Рекомендации по теме
Комментарии
Автор

Any reason you marked MailSender with @Resource instead of @Autowired? They both seem to work for me. What is the difference? 

DanVega
Автор

Really good explanation and understandable. Thanks .
Can I get all your other videos ? . Can you please help me to get it.

VinothKumar-ltbu
Автор

If we have multiple implementations of mailSender class. How does spring know which implementation needs to be returned when injecting the dependency ??

DotaraZr
Автор

When I put @Resource and @Component, show this exception:

Exception in thread "restartedMain"
at Method)
at
at
at
at
Caused by:
at
at

Do I need to set some thing?

Renatocoarreamdepaula
Автор

Any specific reason you use SLF4j as opposed to log4j2? 

DriftingSamurai
Автор

When I try, its failed.. error log "Error creating bean with name 'mailController'".. I already follow this video but failed..

log:

Error creating bean with name 'mailController' defined in file Instantiation of bean failed; nested exception is Failed to instantiate Constructor threw exception; nested exception is
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at [classes/:na]
Caused by: Failed to instantiate Constructor threw exception; nested exception is
at
at
at
... 17 common frames omitted
Caused by: null
at ~[classes/:na]
at Method) ~[na:1.8.0_102]
at Source) ~[na:1.8.0_102]
at Source) ~[na:1.8.0_102]
at Source) ~[na:1.8.0_102]
at
... 19 common frames omitted
Caused by: java.lang.ClassCastException: cannot be cast to org.apache.juli.logging.Log
at ~[classes/:na]
... 25 common frames omitted

TheBobbysetiawan