r/javahelp • • Oct 22 '20

How to learn Spring boot as a beginner?

Hi everyone, I just recently started learning Java after 5 years of not coding (basically, it's like I started from scratch). Now, I want (or need because job requires to) to learn Spring boot but every book I preview or the tutorials I watch throws terms that are unfamiliar to me -- like EJBs, Servlets, Maven, build tool, Thymeleaf, Beans and many more. It's like these books/tutorials, although claiming to be for beginners, assume I should already know these things. If it's imperative I know these terms, then I don't feel comfortable moving on with Spring boot without having knowledge of these things first.

If anyone can give me input as to how I should learn Spring boot like -- what are the pre-requisite knowledge should I acquire? Currently, what I have studied so far is Core Java.

Thanks for any help!

Edit: Thanks for the answers so far. From what I'm getting, Core Java to Spring boot is a bigger leap than I anticipated. Atleast now, I can plan my learnings from your suggestions.

30 Upvotes

13 comments sorted by

•

u/AutoModerator Oct 22 '20

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions

  • You include any and all error messages in full

  • You ask clear questions

  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost. Just use the edit function of reddit to make sure your post complies with the above

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

14

u/[deleted] Oct 22 '20

I like to make this comment whenever I have to explain what spring boot does:

Each Spring module reduces a coding problem to a configuration one. Most of the times all you need to make it work is to define one or two beans.

Spring Boot reduces the configuration even further. It is a set of default configurations for Spring, so you just need to adjust a few things.

As said before, trying to learn spring boot skipping spring framework is really adventurous. But don't try to learn it all at once, spring is really huge.

My five cents are.

  1. Get familiar with Maven or Gradle, learn how to add dependencies and compile your project. (Each one is pretty big, but don't go too deep on that hole)

  2. Get a little background on Dependency Injection and Inversion of Control, since those are cornerstones for spring.

  3. Make a simple REST-like CRUD application with Spring MVC and Spring Data JPA

  4. Do the same application with Spring Boot.

  5. Jump into the jungle and be ready to learn more as you need it.

4

u/wildjokers Oct 22 '20 edited Oct 23 '20

Spring boot is just a configuration framework for Spring. So the absolute first thing to do is read the manual for Spring Core. You will learn what "beans" are here.

Spring has tons of libraries but the one you absolutely need to know is Spring Core. Once you know Spring Core you can read the documentation for any other spring libraries you need. Then you can also read the doc for Spring Boot to see how it helps with configuration (spring configuration can be a nightmare which is why Spring Boot exists, spring is so complicated it needed its own configuration framework).

I am not sure why EJBs would be mentioned in a Spring tutorial, unless it was a "history" section. Don't worry about them.

Servlets are part of JakartaEE (previously JavaEE) and under-the-covers Spring still needs to use the Servlet spec, there is a single DispatcherServlet but you don't need to worry about it or even know it exists. Again I am not sure why a beginner spring tutorial would mention servlets.

For general java you should definitely know about build tools, specifically Gradle and Maven. Build tools are not just for spring. Need to know about these in general. However, it isn't a prerequisite for learning spring. You can pick-up enough to get by as you go.

Spring supports creating views server-side, Thymeleaf is a view technology which you can read about if you need to create a full stack app that generates views server-side (less and less common these days).

Learn spring core first, the reference doc is outstanding:

Don't even worry about Spring Boot until you read the spring core doc.

After reading Spring Core and Spring Boot docs the next spring libraries to read about will probably be Spring MVC and Spring Data. Those are pretty ubiquitous.

3

u/tridiumcontrols Oct 22 '20

Check out this course, by far the best course on spring boot.

https://www.udemy.com/share/102dJe/

0

u/[deleted] Oct 22 '20

[deleted]

3

u/[deleted] Oct 22 '20

The price of the course is $15 - if it goes to $125, wait a day or two.. it’ll be $15 again.

1

u/tridiumcontrols Oct 22 '20

This, the courses are all on sale, they run a promotion. And if they do not, reach out to customer service and they’ll give you a discount code to use. I’ve had success with this.

1

u/tridiumcontrols Oct 22 '20

Good luck, it helped me.

3

u/Tacos314 Oct 22 '20

The into guides give you the exact code step by step such as this, although it does assume you know java and can install Gradle or maven

https://spring.io/guides/gs/rest-service/

3

u/Apostle_1882 Oct 22 '20

I did the Web Quiz Engine project from Hyperskill and found it a good introduction to Springboot. You will still need to do a lot of your own research and googling but the project lays out what you should be doing. The comments were really helpful.

3

u/Ferlinkoplop Oct 22 '20

Java Brains has good videos on Spring Boot

1

u/Chris_TMH Oct 22 '20

Enjoy, learning Spring has been a really enjoyable experience overall, though I felt a fairly steep learning curve at the beginning just to "get things working". Was thrown into a greenfield team, "Go make a Spring boot backend" and nobody in the team had any experience beyond vanilla Java. Was a blast.

I feel like you are were I was two years ago. If you want a chat, just send a PM.

1

u/[deleted] Oct 22 '20

That’s because you need to learn Spring before you learn Spring Boot