ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
Spring Boot Tutorial for Beginners (Java Framework)
ฝัง
- เผยแพร่เมื่อ 2 ก.ย. 2019
- Learn Spring Boot in this full course for beginners. Spring Boot is an amazing framework for building Java applications. It makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
💻 Code: github.com/ami...
✏️ Course from Amigoscode.
🔗 Subscribe to Amigoscode TH-cam channel: bit.ly/2HpF5V8
🔗 Full Stack Spring Boot | React | Postgres Course: bit.ly/2NGmUx3
🔗 Visit Amigoscode.com for more courses: bit.ly/2JgGW0w
🔗 Follow Amigoscode on Instagram: bit.ly/2TSkA9w
🔗 Join Amigoscode Closed Facebook Group: bit.ly/2FbuIkx
--
Learn to code for free and get a developer job: www.freecodeca...
Read hundreds of articles on programming: medium.freecod...
10:00 resources contain static folder for all the web resources
templates for web applications
15:00 we are using mvc pattern
24:07 using @repository annotation creates bean that can be dependency injected
we also used annotation to create the api url, and map 'post' request to addPerson method in the controller/api
reached 1:04:50
hi do you have the code plz !!!
I think this is intermediate class, based on the pace with which you drop the concepts. This is a good video for an individual with exposure to other frameworks
Agreed. Pace is very fast and concepts are not explained. Beginners should look elsewhere.
@@alexblack1234 do you have any beginner recommendations?
Watching this video, I had to write a comment to say, as a Javascript; React and Node.js developer this was so incredible and simple to understand. Thank you so much for this video because it’s made things so simple to understand and it’s so well explained. Can’t thank you enough.
I think that it's worth mentioning a couple of things here.
1) @Autowired (when used with a constructor) is only required in case there is an ambiguity; meaning more than one constructor.
But there's nothing wrong with being clear that dependency is injected by Spring
2) Instead of using @Qualifier in the constructor parameter, you can just give the name of the bean that you want to be used.
Example:
public Person(PersonDao fakePersonDataAccessService). Notice the casing *fakePersonDataAccessService* in lieu of *FakePersonDataAccessService* or just *FakeDao* if that's how you choose to explicitly name your bean (as shown in this video).
I am able to send a post and get a request successfully in 43 minutes but using id localhost:8888/Api/v1/person/0cbd3327-b1bd-4332-819c-ebcf2890b34a keeps saying Not Found with 404 Error. Where did it go wrong?
For those whose "@NotBlank" and "@Valid" is not working, Paste the below dependency in your pom.xml and restart your IntelliJ.
org.springframework.boot
spring-boot-starter-validation
thanks mate
Or just import the dependencies using maven where error is showing .
Inserted, but still not working
@@DavidDag14 I used this:
jakarta.validation
jakarta.validation-api
2.0.2
This worked in Eclipse without rebooting, thank you!
I haven't used Spring in a couple of years and I would really like to thank you for providing this tutorial. Really came in handy! Also, your voice and pace are on point sir :)
nice online course for new java programmer. Speaking slow and making everything easy to understand ... I can't love it more
This guy is such a good teacher. I'm learning Spring right now and his channel has been the best source for my starting projects.
I am new in backend technology. Can you tell me that if this crash course is still relevant in 2023.
Can I leran it with basic understanding of java
Awesome tutorial! I just LOVE the calm voice.
Also when he got started with the REST, for almost 30 minutes straight I was just like "Say whaaaaaaat? That ain't no work, that's fun!"
I want to thank this guy a lot, I need to learn spring boot for one of my classes and all the tutorials out there are really bad, but this guy explained it super good so thank you so so much keep doing it!
24:17 "@Repository annotantion makes it obvious that this class is served as a repository". Then the narrator goes on, not bothering to explain what a repository is. What a great tutorial.
To save time and confusion, Person class is initiated by postman at the near end of the api/service class …But Person object is passed as a parameter from the beginning of the tutorial, also note we can have interface type objects (pls read) i.e the objects need not be of the class which we conventionally study but can be of the interface which classes consume.
I feel like you're not explaining the concepts and found myself coding along and using these libraries without having an understanding of what they are
I'm also a learner of this topic. But in scattered moments, I watch a video before and faintly remember that injection happens at constructor. Then i remember also, that XML is the underlying connector in the old times. But despite that, the whole DI thing is still vague and I didn't care because I don't do java anyway. Until today, when i watch his video the concept all seems to connect to me with a bang! His tutorial is extraordinary, many just didn't realize it.
That's TRUE
@@ATRISENGUPTABEC type me in telegram @k0tarak
You need to know Spring core before following this video. He should have said that at the beginning.
Have the same feeling ! i think we're lacking some parts in order to understand what's happening ! I think it should have requirements.
08:00 Spring Boot generated project
09:53 resources folder
11:51 How it will implement the layers
14:06 Definition of the domain models
15:45 Define database section | PersonDao
18:19 FakePersonDataAccessService
19:52 PersonService
27:07 REST controller
28:11 Send a POST request from PostMan
32:53 Implement a GET method
thanks dude
I usually dislike long tutorial videos for being so bloated and not to the point, but I am 1 hour into this and I can already grasp what Spring is about. Many thanks
I'm not very advanced at Java, but honestly this tutorial and the tutorial of Functional Programing are very easy to understand!
Very nice tutorial explaining docker, spring, rest,postgres, postman. Should be marked intermediate in my opinion.
Great video. However I faced one issue in between that I would like to point out:
1:00:00 When trying to add @NotBlank, if you get an error, then you would have to add javax.validation .validation-api dependency in Maven. How you do that is by going to Maven repository and searching for this dependency. Then select the particular version link and copy the maven dependency. Finally sync your maven dependencies. Then you will be able to use it.
Let me know in the replies if you guys have any more questions around this.
I have no idea if I am doing this right but pasted the snippet into the `pom.xml` file within ``:
```
javax.validation
validation-api
2.0.1.Final
```
It goes on to say that `javax.validation` is not found. I'm guessing that I have to link it to a URL since it is a remote source.
🤷♂
I've done that, but when I added the NotNull and Valid annotations, and restarted the app, nothing changed. I can still add users with empty name.
@@dawnriddler Same here
25:45 - this is the best reason of why we should use dependency injection annotations I’ve ever seen, I was so confused up until this point - only having to change a single word to change entire technologies
- IF ANYONE IS UNSURE ABOUT WHAT DEPENDENCY INJECTION IS - WATCH FROM 23:20
Even thought the tutorial is good the naming conventions followed are very confusing. Also, clear distinction between different layers isn't explained well. Focus is on execution towards working code rather than explaining the core of Spring Boot.
Yea it was hard to completely understand, but I think I get the gist of it. The person Controller is an API clients can communicate with. The PersonService is essentially a middleman between the API and the DB access layer. I'm guessing this is a best practice and there's probably more logic you can add to the service as well to eliminate repeating code. The Person Model is just our person class so that we can use the object/attrs across the project. Lastly, we have PersonDao and our Fake DB. I'm not sure why, but we have the interface to support multiple ways to access our DB then we have our Fake DB which stores our people and gets/manipulates them as well.
@@TheJuniorDev1 The way I see it is that, the interface is one of the fundamental materials for dependency injection to work. Without it, I don't know how else it is possible. The injection happens in the constructor, and the annotation is the extra information used to decide which concrete implementation is chosen.
Yes, exactly idea is clear and the video is good but these namings are killing me while watching it
@@cardsigner abstract classes?
PersonDao handling with DB extends Crud functions
You're very good teacher. I've seen your website and it is amazing. The way you explain things is really really helpful. Few are those who know how to to teach, you're one of them. Congratulation.
The explanation is missing which may cause issues for beginners, but otherwise the perfect example of spring boot with working back-end functionality.
Hey @Amigoscode great video - it would be helpful if you defaulted "imports ..." to be open, on your IDE, so that we can see whether we've got all the needed imports! Normally those default to closed, but because you're teaching it would be helpful for us. Thanks, and keep the Java videos coming please! Your content and teaching style is what's needed.
Awesome stuff. Hard to find a spring boot beginner course where you follow through, and everything works as expected, without encountering errors the teacher didn't experience.
Lol
One of the best tutorials I have ever came across.
You are a real “amigo” (friend) :) I really appreciate your time, explaning and helping a lot!
Dude you are the best, clear explanation, just the right pace, everything worked as wished
Thank you very much my friend! I've whatched this tutorial and it helped me a lot to get my first job as a backend developer, obviously I've been studying the basics for software development, but you helped me so much! Blessings and best regards.
Does anyone believe these comments….
@@alperengul8654 I dont believe anyone, its much harder than that and after one year of learning programming i realize that more and more.
"For beginners" must be relative...been coding w/ Java in IntelliJ for a while and still had trouble following along. Nothing is really explained, just sort of done. Had to re-watch a lot of what was going on with the Postman section to try and understand what was happening and why.
By far the most useful tutorial..
Finally someone who connects to real databases and is not using mocks only :)
Thank You
Thanks a lot, while at first I didn't really understand what was happening, once I drew everything in a piece of paper, things cleared out pretty quickly! Maybe try to make a connection between the graph at the beginning and the actual Classes and code once in a while, I feel like that was what was missing for this tutorial to be perfect!
Thanks!
I am using Java 17 and in the validation part of the video I have done as told to do, but I am still not getting an error when passing an empty or blank string.
Nice, I am an AmigosCode subscriber and I follow his courses on his website; this man really loves and knows Spring.
Valeu Nice speech/accent for non-english speakers like me.
Many thinks Nelson for this incredibly straighforward walkthrough!
at 40:30 if you are stuck, with .orElse( other:null); just write .orElse(null), intelliJ will complete with the correct tag after.
I learned perfectly Java OOP and i wanted to make a web app too, it looked soo hard before i watched and followed this guide. Thanks pal
Heck even wanted to just continue using nodeJS (dont get triggered please)
Thanks Freecodecamp and the instructor.
This has been ultra useful to "spring" board me into the world of Springboot. Thanks!
The first part was very good but later in the course there is quite a few magic there. How does the Hikari datasource know where to look for the configuration file? Is application.yml has to be named exactly like that? How does flyway know which files are part of the database project? what if I have multiple databases?
This too is mystery to me
please upload more tutorials about spring boot you are just amassing all your tutorials are working properly big up to you and thanks for your help
i"m a die hard netbeans IDE fanatic. I love its old style GUI which makes me feel am still coding in the 90s.
i am looking for a static code analysis tool for version 12 of netbeans Can you help ?
just copied this from Clases UTN FRC below so i can see easier lol
08:00 Spring Boot generated project
09:53 resources folder
11:51 How it will implement the layers
14:06 Definition of the domain models
15:45 Define database section | PersonDao
18:19 FakePersonDataAccessService
19:52 PersonService
27:07 REST controller
28:11 Send a POST request from PostMan
32:53 Implement a GET method
Best begginer spring boot course out there!
It would be much easier if you add setter to person name and your in memory DB service would use Map instead of list
I am soo grateful that this video actually helped me get to understand a few instances
I am a beginner, could you please offer a course on spring boot. I love this❤❤❤.
th-cam.com/video/vSxK5cOQujI/w-d-xo.html Please have a look at these videos, If you don't understand the concepts no need to like the video
Feedback:
The code that you do in the video is not the same with the github link on description.
I feel that the code structure in the video is cleaner than the one in github, so I am trying to follow your style on video. However it's annoying to fast forward / rewind the video just to look for reference.
But in general this helps me a lot getting back to Java after being absent for 2 years
Thanks, I can finally add Java Spring Boot into my Linkedin 🙈
very good starter video for a starter person to go through all the concepts once
15:00, you have to create the packages api, dao, model and service on your own.
this tutorial helpful thank you very much for the annotation @valid and @notblank i didn't found them i just add validation dependencies and its all good for who had this problem , thank you
Add this in pom.xml and try
javax.validation
validation-api
2.0.1.Final
org.hibernate.validator
hibernate-validator
6.1.5.Final
Thank you! I feel like I am ready to start my next project with spring boot!
1:23:10 If you still get error "Failed to configure a DataSource: 'url'" change application.yml to:
spring:
datasource:
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/demodb
username: postgres
password: password
pool-size: 30
And in PostgresDatasource:
@ConfigurationProperties("spring.datasource")
And it should work (Spring 2.4.4)
Thank you! It helped me!
thanks a lot for the excellent explanation!!
Very nice short and fundamental tutorial for a such big spring boot platform. This gave me a very good overview and purpose of using spring. I will learn the advanced portions as I move along
Agreed. We need more spring boot pls.
Need to add below dependency to use @NotBlank annotations otherwise it it wont be resolved on some spring versions e.g 2.6.6
org.springframework.boot
spring-boot-starter-validation
Thanks it worked !
Not the best explanation of how Spring comes into play around minute ~24. "The way that we inject is add @Autowired - basically we are autowiring into this interface." is not an explanation...
It's a good tutorial but there is a big lack of explanation.
He is describing what he does rather than explaining it.
If one looks too closely into the pixels, the image will not be visible. Those @auto things and whatnot are only instruments or materials from which the entire theory is built upon. The core concepts are: constructor, XML, interface and using the letters of the alphabet to switch from impl1 to impl2 via a common doorway.
@@cardsigner The metaphor isn't accurate at all. Here, if you aren't wiring things correctly, the whole service won't work.
Imagine you want to learn how to drive and your teacher just go into the car and tell you "basically I'm just driving, I move the steering wheel, I use the pedals" and then you have to guess when and why you should use the clutch or not.
Moreover, he could just have explained that @Autowiring is the way to tell spring to use this method to inject the required beans into the constructor/setter instead of just saying "we are autowiring stuff".
Despite what you are saying, bean are the core part of Spring and if you don't understand how bean injection works, you will end-up with some bugs.
Amigos is awesome but he can improves and there is no need to bash people making good critics.
And I would add that:
In a code comment, you aren't suppose to write what the code does but why it does what it does.
This is exactly the same: the images of the video are the code (literally) and the comments are the audio.
There is no point in telling people what you are doing X when they see you doing it.
@@xtunasil0 the java ecosystem is always in flux.. so it is not possible to state precisely certain things. For example, Java 8 has no List.of. And then, the newer spring-boot did not include validator. So,yes.. the teacher has to get into the car and the student has to learn to drive right away. The foundation itself is moving, so no need to stick to those noisy syntax, those are not the essence...
Setting this tutorial up using Docker was a bad idea. Docker is a touchy technology under the best of circumstances, trying to learn all these other tools while troubleshooting Docker at the same time makes this very difficult to follow. Better to just show us how to setup the database on it's own without the unnecessary containerization. I was able to get the basic CRUD app working so thank you for that, but I still don't know how to integrate a persistent DB with the app because I'm not able to get Docker up and running on my machine.
Windows users would have difficulty running docker ...
Thanks for this great tutorial. As a genuine newbie to this, one thing I puzzled me is that till 0:40 there isn't a real DB, it was just an array running in the memory. Not sure if I've missed this at the beginning, otherwise it will help if this is explained a little bit more.
This is absolutely fantastic! I had a great time learning this amazing tool.
Thank you very much for making coding resources available for free with high quality!
th-cam.com/video/hReX-FCyJZY/w-d-xo.html if you don't understand the concepts then don't like the channel
After two years, constantly trying to learn spring boot.....
I can finally give up
This really wasn't beginner friendly lol. I understood the javaspring part but he lost me at postgres/docker
If you want to learn why is what ?
And want to know core of spring, not the magic of spring boot, but straight Fundamental of Spring Core from scratch,
I learned it hard way , if interested i will reply.
Yes I wanna know how did you learn it
@@haqtechnofox first i learned concept of dependency injection ,
Then learned What is pom.xml & Maven
Just learn it from anywhere (I learned it from Telusko)
With this knowledge i learned how to Download jars and automatically add them as dependency in project.
Then to start learning Spring from scratch head to channel : SeleniumExpress it has whole playlist where instructor teaches best way possible , just with enough concentration you can easily learn it.
@@morning5tarr Thanks alot 😇
You are my game changer love from india
Tip:
You can create the `spring-boot-postgres-db` using CREATE DATABASE "spring-boot-postgres-db"; :-)
I'm getting stuck around 1:32:05. I've followed along with the code exactly. In the terminal, I'm inside demodb-#, but in IntelliJ when I try to run the server I get the error the database "demodb" does not exist :(
I know core Java
Can I do this course or do I need to learn more?
Awesome! Thank you so much for this tutorial! 💛
im stack :/
Description:
Parameter 0 of constructor in com.example.People.People.api.PersonController required a bean of type 'service.PersonService' that could not be found.
Action:
Consider defining a bean of type 'service.PersonService' in your configuration.
Process finished with exit code 1
Thankyou so much, it was quick and crisp to get started
For anyone who wants to keep the DB as spring-boot-postgres-db all you need to do is put it in quotes. So: "spring-boot-postgres-db" This error will happen with many other dashed tables / databases if you dont put it in quotes.
ty!
Outstanding tutorial, can't express my gratitude enough, so well explained and good pace
I am very grateful for this tutorial. Thank you for everythink!
Excellent presentation. Well-explained, simple, accessible, and uses good code practice, too. Thank you for posting this, it has helped me get my feet wet in Spring Boot!
I'm also wet here..
Amazingly explained, very thorough, thank you!
In PersonService.addPerson() method you're calling insertPerson() which is not implemented ,throwing compilation error.
Yes.. i noticed that too... but overcame it..
Very Clean & Informative tutorial. Thank you for your hard work. Cheers !!!!! ⭐⭐
thanks, this is great, exactly what i have been looking for.
At 26:15 I had an error: Autowired members must be defined in valid Spring bean (@Component|@Service|...)
I fixed it by adding the supress warning:
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
or delete the "final" here: public PersonController(final PersonService personService) {
This is well needed considering Java is the main Language im learning right now in college
Java is actually the main language since over 20 years
Fr! If only I could find a java tut where the instructor doesn’t have a heavy accent
I loved this course. Nice pacing and the content is great.
i get 404 ERROR when i lunch for the first time i've exactly did the same things as you but it does not work at 33:15, some help would be verry apreciated thx.
Check if the route defined in the @RequestMapping is correct
Were you able to fix your problem? I'm getting the same error and the RequestMapping route is correct.
I fixed it by adding my project name in the url so mine looks like localhost:8080/SpringBootFirstTry/api/v1/person
Who the hell told this is beginner level spring boot
I like how you clearly explain thanks alot
Thank you for this tutorial. I have been trying to follow a few different spring boot tutorials but kept running into issues. I was able to follow yours so easily!
would you like to explore this topic together? :)
th-cam.com/video/vSxK5cOQujI/w-d-xo.html Please have a look at these videos, If you din't understand the concepts no need to like the video
Really a very good tutorial. Very well explained and structured. Thxs.
Nice video, thanks a lot! - only thing i would say would be to try to explain a bit more the context behind the tags and structure you used, for example, why the use of tags, why the folders being used in that fashion etc... kudos nonetheless!
Master! this is awesome and so are you. Learning made simple.
I think, better to use Optional.get() instead of Optional.orElse(null);
Alhamdulillah, great job akhi!
This is probably the best spring boot tutorials I have ever seen. Explained more details and than top udemy spring courses. Also, I saw some developer experience in there which is not compared with any other beginner spring boot tutorials available like Telusko where self-taught with no practical experience are teaching the programming.
I seriously love these tutorial videos. Thanks for sharing!
Excellent video, you explain in a very easy way to understand, thank you so much for share your knowledge!!
You're on of the best teacher. Do you have any Spring learning channel.
Awesome tutorial Amigoscode!! Thanks a lot
Great video!! Thanks for walking us through it. Great resource as a refresher as I'm applying for a Java Spring Boot job.
How do we decide the endpoint? Like at 29:20 we gave the POST endpoint as "/api/v1/person" is there any reason behind this
Please explain
thank you for this tutorial,
Question:- why is insertPerson default ,,,,, & why didn't we do the insertPerson inside the implementation class what is the reason to do the function inside the interface?????
what is the advantage that makes us not to implement insertPerson inside the implementation class and do it inside the interface??
Thank you, hands down the best tutorial
Thank you so much for sharing this course.
tu si eres un amigo real.