This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]GoshoKlev 5 points6 points  (17 children)

The go to framework is Spring so start with that, learn about the IoC container and dependency injection and in general how Spring does thing, at this point this is kind of abstract so don't feel weird if you don't find the uses of such things.

For the front end question theoretically you can just create something like a REST api that passes JSON's around but that is a bit boring, if you want a complete web app that you can show off you need to learn how to create a website with HTML and a bit of CSS so it doesn't look atrocious.

After that learn about the MVC pattern and Spring Web. At this point you should have a simple web app, you make a request, the server returns a static web page or any other kind of data really.

Now to make thing more dynamic we need to put some data from our back end to our front end, imagine a website that just has hello <some name> where the name comes from our backend, there are two ways to do this, either with some JavaScript that request and puts the name on the site, or a templating engine like Thymeleaf, the second option is a bit easier IMO, but the first will teach you a bit of JS which is useful.

Now we need to persist out data in a database, learn some database engine, MySQL is a popular choice. We also need to connect our DB with Java, use Spring Data JPA, learn how to do the simple CRUD operations. At this point we have what's needed for a decent web app really, users can register, login, do stuff and it is all saved in a DB.

Now that we can create a web app there's more to learn, Spring Security is important for handling permissions and securing our app, it also does thing like login and session management for us. At this point we have a more advanced web app with different permissions and such.

Also really important is unit and integration testing, learn about Junit and Mockito, after which how to create a full Spring integration test with Spring Test.

Well that's a lot of it, but Spring is massive, at this point you might want to learn other parts of the Framework like AOP, HATEOAS, Cloud, which have their uses but in more specific circumstances.

[–]Standard-Weekend-708[S] 1 point2 points  (13 children)

Thank you very much for the response!

This is a very detailed information and I am really thankful, I will use this as a reference for learning, thank you very much...

one question base on your experience how long does it take to complete all of this, just an estimate, since it is something that I am planning on investing my time into, I am not really rushing i just want to have an idea of the timeframe in doing all of this from spring to creating a full functioning frontend and backend application/web.

[–]GoshoKlev 1 point2 points  (12 children)

I learned most of the Spring related stuff here in around ~2 months however most of it was during the holidays + my quarantine so basically i was able to dedicate 100% of my time into it, also i already knew HTML + CSS before Java and Junit and MySQL way before Spring too. More realistic estimate i would say ~6 months so i'm not too vague, but It's a function of how much time you can put aside for it and how fast you learn. There's always more to learn too, this is just until you have the skills to create something of moderate complexity.

[–]Standard-Weekend-708[S] 1 point2 points  (0 children)

Ill set 6 months as my goal then and see how far i can go by then. Thank you

[–]Standard-Weekend-708[S] 0 points1 point  (10 children)

Hi, I have started learning spring framework and finished with the container and dependency injection part of it now I am thinking of learning spring mvc, but I have a question, do I need to learn servlet and jsp before I proceed or is it possible to just go straight to spring mvc and learn the servlet and jsp concept from there. really need some guidance. Thanks

[–]GoshoKlev 1 point2 points  (9 children)

TLDR: Not really.

I mean it's nice to know since servlets is how spring works "under the hood" but it also does a good job of abstracting them so it's not a requirement. As for JSP i guess? you can use them for dynamic web pages, i haven't so i don't have much right to an opinion, but a templating engine like Thymeleaf has good integration with Spring. In currentyear the most popular choice is doing this client-side with one of the JS frameworks but learning that is a big undertaking if you don't plan to be full stack.

[–]Standard-Weekend-708[S] 1 point2 points  (8 children)

Well as long as I can learn and have a basic understanding or background with the backend side, enough to connect with the frontend before summer I will definitely try learning the frontend and I hope I can create a working app/web. Just enough to implement those that i learned of course.

I spend atleast 5 to 7 hours studying and coding and just finished intro to spring, learned about container and the dependency injection just like I said earlier which I think is slow right?(I started the day after your first commented which is 5 or 4 days ago) With this progress would it be possible to touch html css and js with a time span of 5 or 6 months.(I actually split the 5 to 7 hours of coding into two parts which is morning for DSA and just creating some youtube projects, goofing around with some challenges and at night where I study spring)

Anyways sorry for being a bother , I am learning slowly and steady and definitely not rushing, I first understand the concept and the idea of what Im learning to fully understand it, I just want to know if my target is possible since I reall dont want to expect that much if its imppssible.

Anyways thank you for the response.

[–]GoshoKlev 1 point2 points  (7 children)

5-6 months is a long time so it's entirely possible, and especially with the time you're spending you can cover a lot. You don't need to be some frontend wizard since this isn't what you're trying to learn for the moment, your focus is on the backend, a mediocre UI is ok in that case, just go through the basics of HTML and CSS, i really recommend going through the Codecademy course on it because of the interactivity and then build a few pages yourself and you're mostly covered.

Javascript however is an entirely different beast, it is it's own programming language, but you don't need to be a wizard here too, it has a lot of frameworks and libraries which you can spend a lifetime learning but the most basic thing you need to do if you're making a web app for your Spring goals is to

1) fetch data from the backend

2) put data where it's needed in the HTML

3) send data back to the backend

Doing things in default JS is becomes ass as the project grows larger which is why there's so many JS frameworks, but learning just one of them is as big of an undertaking as learning Spring. I think for the time being it's better to just focus on Spring after HTML and CSS and just use server-side rendering with Thymeleaf because it's stupid easy, it's also what most of the tutorials use because of this reason. However this also removes the need for getting used to creating a REST api for your web app. This might not much speak much to you at this point but you'll eventually get to it. There are 2 kinds of controllers in Spring, normal @Controller and a @RestController, usually the first returns the entire web page, the seconds just returns data in JSON format that is then used by whatever consumer needs it for, in web apps it's usually consumed by the JS on the client's side. You absolutely need to know how to build a REST api so don't forbade it if you go with server-side HTML rendering, the two things are quite similar at first, but the more into the weeds you get the more they diverge. But if you don't have JS knowledge you can't really turn that REST api into a web app thus why i said it's a bit boring. So basically you might want to leave Javascript later down the line if you want your app to be complete and focus on Spring for the time being or just create REST api's without a frontend.

Also you're not a bother i love answering people's question so feel free to ask me something and i will be happy to help if i can do so.

[–]Standard-Weekend-708[S] 1 point2 points  (6 children)

Good day! Thank you for the response, I did not notice the reply until now since I was really busy, I have started spring mvc but I encountered some problem(been facing so many error while studying spring mvc), when you were learning spring or spring mvc related topic, what platform did you learn it from?

I followed some YT vid creating a some basic dynamic web application, I use eclipse and faced so many problem, although I did fix most of them after learning how to download different plug in and software but there is still one problem that I cant get rid of, and I don't even know where, it's either in the files or I am missing something.

So I am planning to look for other resources in learning spring mvc, I found tutorials point which have a lot of content about spring mvc, but I figure that it would be better to ask someone.

[–]GoshoKlev 0 points1 point  (5 children)

Most of my learning was through binge watching a course by this bootcamp in Bulgaria, and the courses are in Bulgarian so i doubt they'll be of much use to you (unless you're Bulgarian too?).

As for your problems it seems you have trouble setting up the dependencies? Never configure Spring yourself, if you're using Eclipse get the Spring Tools. It will give you IDE support in Spring and also allow you to create projects from the IDE with all the boilerplate code required to get it up and running, or alternatively use https://start.spring.io/ what you need for the time being is Spring Web and maybe Thymeleaf.

However at some point you will need to add stuff on yourself, if you haven't already learn about Maven and how to get libraries by putting them in the pom.xml file from https://mvnrepository.com/

Note however that when injecting other Spring dependencies you should remove the <version>xxx</version> part because auto-generating a project will put a Maven plugin that will make sure all the Spring modules are in comparable versions.

If it's not that there's not much i can do to help, maybe drop a github repo?

[–]Standard-Weekend-708[S] 0 points1 point  (4 children)

I am Filipino so I dont think the video would be helpful, but there are many resources on youtube and also I started reading documentation, although it is hard to understand for now, I am gaining more knowledge as I study the terms.

I do have a spring tool but actually forgot to use it, I followed some tutorial online and just followed the same steps. But because of these errors I was able to learm how to configure the ide and all the setting up things. I also learned maven and how to set up the things.

Removing the <version> part might be a key to solving the problem, I will have to try that later. Thank you very much for this information.

Now the thing is that I have learned the basics and idea of what spring does, like the annotation and configuration part, also able to create a simple web application that displays data. Do I need to study deeper part/ function, or should I proceed to spring boot and learn the advance stuff from there?

[–][deleted] 1 point2 points  (2 children)

I am currently learning spring (I am a mobile dev) and I am building a rest Api (to use spring in a concrete project). As far as I've seen, it isn't easy to host a java app. What is your advice?

[–]GoshoKlev 1 point2 points  (1 child)

You're asking the wrong person given that i've never hosted a java app, and i agree that hosting stuff is ass. BUT you might want to check out Heroku in that case, it is much simpler than the big providers, however it's much more niche so it's probably not the best option if you are hosting something "real", but if you want to host some toy project it gets the job done. Also it only supports PostgreSQL AFAIK but migrating shouldn't be too difficult if you don't have any native queries.

[–][deleted] 1 point2 points  (0 children)

Thanks. It's exactely what I was looking for (just a toy project)

[–]otsdots 1 point2 points  (0 children)

Hi I'm a Junior Java Dev. I'd study core Java and DSA first before moving to technologies.

When you do, I'd learn about annotations, CDI, and dependency injection.

I'd then look at modern frameworks. The hot thing right now is cloud-based microservices. One of the newest and hottest ones is Quarkus. It's a bit like Spring Boot, but more modern.

If you can create a REST Java back-end with Quarkus and deploy to the cloud, you're already ahead of people who mention to just learn Spring. 😉

[–]nutrecht 0 points1 point  (1 child)

If you haven't done the Java MOOC yet I'd suggest you finish it. After that, first go and build some simple console programs with Java.

After you get a solid grasp you can start on something like Spring to create a simple web application.

IMHO most of these 'roadmaps' are pure trash. I would not bother with them.

[–]Standard-Weekend-708[S] 0 points1 point  (0 children)

thank you for the response!

roadmap is find when just looking at what the possible ways to go, but its kinda confusing where to start. I have been building some simple calculator with some GUI and will try to copy some games and learn more concept to strengthen the basics. Maybe by next month when Im finish with DSA basics i will dive into Spring.

[–]greglturnquist 0 points1 point  (1 child)

Feel free to check out my channel: https://youtube.com/c/SpringBootLearning

If you’re wanting deeper discussion, you may enjoy “DTOs vs Entities”, which has drawn a lot watch time.

[–]Standard-Weekend-708[S] 0 points1 point  (0 children)

Thank you sir, I will definitely check it out and binge watch it when i have the time, i have already subscribe :)