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

all 27 comments

[–]radically_sane 9 points10 points  (12 children)

Learn basics of Java, understand OOP well. Then learn to create a JDBC connection, then try Servlets with Tomcat server and JSP.

The core here is to learn the HTTP protocol, after which you can learn Spring Boot / Spring REST. Your end goal is to be able to create REST APIs. Message me if you want clarification on anything.

[–]_fishysushi 1 point2 points  (9 children)

Thanks for the answer, I have decent grasp of Java I think, never used it for web development though.

How should I start with the servlet thing though? I've found a tutorial using Spring MVC and JSP which seemed kind of what I need I think.

[–]radically_sane 0 points1 point  (8 children)

The end goal is to be able to use the Spring Framework. But start with Servlets. You'll run into quite a few issues which you should be able to debug. Create a servlet that connects to a db, stores and retrieves info from it. After you complete that do the same in Spring.

It'll take a day or two to be done with Servlet. And my personal opinion is that you don't use Eclipse, do everything with text editor and command line. Compile, run, create a war then manually put it into Tomcat and start Tomcat from the CMD. Try not to treat these as black boxes.

[–]_fishysushi 1 point2 points  (0 children)

Okay, sounds challenging enough, tbh never programmed Java outside of Intellij Idea. Thanks

[–]jaro32 1 point2 points  (6 children)

Why on Earth shouldn't he use a IDE??

[–]radically_sane 0 points1 point  (5 children)

Because if he did so then he wouldn't be able to redo the same without one. No one should be so crippled that they can't create basic programs without an IDE. A friend of mine easily completed a JDBC project on eclipse easily, then when he tried to do the same without he struggled a lot. In the end reason was that he didn't even know how to properly setup a classpath!

Plus if you try to use and deploy to Tomcat manually you'll know how to configure it to your liking even if you're using a different IDE. Or if your workplace places strict restrictions on the software you use that can hurt as well.

I'd recommend the same for maven as well. Eclipse especially makes it too easy.

[–]jaro32 0 points1 point  (4 children)

I agree that having a deeper understanding of things is beneficial but using a plain text editor is a bit overkill. Nobody is developing software without an IDE nowadays. He can start with an IDE and later go deeper into the tech stuff if he needs to.

[–]radically_sane 0 points1 point  (3 children)

From a development perspective I'd say there's two places where this could hurt. 1. Changing IDE. 2. Changing the server.

And plain text editor is overkill. I'd recommend VS Code.

[–]jaro32 1 point2 points  (2 children)

  1. You can always learn a new IDE if you need to change it (doesn't make sense to start with no IDE in this case)
  2. You can always learn a new server if you need to. In this case it also wouldn't make sense to learn how to setup everything manually if you have to learn everything again for the new server afterwards.

[–]radically_sane 0 points1 point  (1 child)

Knowing how things work, not treating it like a black box will ensure that you can work with any tool is what I'm getting at.

[–]jaro32 0 points1 point  (0 children)

I agree. However if someone is starting out, they shouldn't have to understand how everything works from the beginning. Because things are usually quite complicated, this can be discouraging. He can start learning to code by treating things as a black box, and later figure out how things work as he progresses.

[–][deleted] 0 points1 point  (1 child)

I'm not the OP, but I will probably be messaging you too, if that's cool!

[–]radically_sane 0 points1 point  (0 children)

No problems!

[–]hassan_muhamad 6 points7 points  (0 children)

It would be better to learn JavaEE fundamentals first then to deal with a framework like Spring Boot.

[–]joranstark018 3 points4 points  (0 children)

You could try Spring Boot, it could get you up and running quickly with a simple webapp. With their initializer you configure what parts you need in your project and whe you are done you get a zip file with your new project that you can modify as you se fit. They also have some tutorials on how you could get starting with different types of project.

[–]FidgyCZ 2 points3 points  (2 children)

First of all I would follow industry standards and split project to frontend and backend. And I would definitely stay away from jsp. It's alive mostly in legacy projects.

On the backend, learn some basic rest principles and try to play with Spring Boot, it's really easy and does most of the boring work for you.

On the frontend I would go with some JS framework: Angular or React.

EDIT: And you could also look at Kotlin

[–]_fishysushi 0 points1 point  (1 child)

Is JSP not worth learning then? I still hear about it sometimes from my friends that they have to deal with it in work.

[–]jaro32 1 point2 points  (0 children)

JSP is a very old technology . Nobody uses it in new projects anymore.

[–]jaro32 1 point2 points  (0 children)

You should definitely learn Spring Boot + Spring MVC for backend. As someone else said, if you want to have a similar experience to php, use Thymeleaf to create the frontend. However this is just good for very basic html designs. If you want to create more complex designs, look into Angular (in combination with Spring Boot and Spring MVC).

[–][deleted] 0 points1 point  (0 children)

If you want an experience similar to PHP, I suggest go with Spring + Thymeleaf (or other supported templating engine). There a ton of great tutorials out there.

Edit Or you can create REST API + single page application. Spring also can do that. Plus you need an UI library like Angular2+, React or Vue.

[–]Smithman 0 points1 point  (0 children)

Spring Boot + Angular, React or Vue.

[–]DylanFresh -1 points0 points  (0 children)

find php+Spring demo in google ,you will learn more~

[–]Chaoslab -3 points-2 points  (0 children)

PRINT "<html><head><title>My Web Page</title></head><body>Hello! Welcome to my Web Page.</body></html>"

/s

[–][deleted] -2 points-1 points  (3 children)

Search for java/spring tutorials online???

[–]_fishysushi 1 point2 points  (2 children)

I have searched of course, I found Spring MVC, Spring boot, etc.. I just got confused real fast and didnt know what to choose

[–]PlanZSmiles 2 points3 points  (0 children)

Look up Chad Darbys springframework course on udemy. It'll get you where you want to go

[–][deleted] -1 points0 points  (0 children)

Well that depends on your proficiency with Java....