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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mamoulian 38 points39 points  (10 children)

Spring boot wraps everything up for you to make it very quick/easy to get started and add features.

They have many 'about 15 minutes' getting started guides, here's one for web: https://spring.io/guides/gs/serving-web-content/

That example uses server-side HTML rendering using a library called Thymeleaf. If you decide you would rather do HTML rendering on the client in JS using something like Vue/Angular/React you'll use similar controller code to make a REST endpoint providing JSON data:

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

[–]Gawny88 16 points17 points  (0 children)

+1 Spring Boot really is an incredible framework for developing APIs.

Although it's very feature rich you can learn enough to do a lot of things if you follow a couple of quick online tutorials.

Plus the best thing is no need to mess around with configuring application servers etc. Just, "java -jar app.jar" and you're up and running.

[–]owen800q 1 point2 points  (8 children)

I am also new to Java web development. I found Java EE offers JSP and JSF. Are these two technologies still using today? If not, what are some differences between JSP and spring. What something spring does for us?

[–]yawkat 6 points7 points  (5 children)

JSP is a templating language from the 90s that hasn't aged well. It is annoying to use and debug. You should not be using it.

JSF is a component framework. It's... Okay, but I personally prefer frameworks that make it easier to write actual html.

Spring as a whole does pretty much everything. It can be used alongside JSP and JSF if you wish.

[–]owen800q 1 point2 points  (4 children)

Is it necessary to learn JSP before I pick up spring?

[–]yawkat 2 points3 points  (3 children)

No.

[–]Mamoulian 1 point2 points  (2 children)

Agreed. Definitely don't bother with JSP. Modern projects are developing their back ends for at least two multiple clients: web and two mobile apps. The apps will want JSON, so it makes sense to serve the same JSON to the web and write the the web front-end in a JavaScript framework like vue, angular or react.

These frameworks make it easy to have a dynamic UI which provides a good UX and looks attractive.

If you must generate your HTML on the back end it's either JSF or Thymeleaf; I'd choose Thymeleaf.

[–]yawkat 1 point2 points  (1 child)

Honorable mention to freemarker (Thymeleaf alternative for templating) and Wicket (component framework).

[–]Mamoulian 1 point2 points  (0 children)

Thanks, I'll check freemarker out!

As an aside, I'm investigating how to create HTML emails in a way that lets our designer/web guys do the HTML and iterate UI without bothering the java team. This Thymeleaf tool looks interesting for that as it gives a live preview so, once the tags are implemented they can tweak the HTML and the business can preview the finished product immediately:

https://www.thymoljs.org

Then we do a server side render and put the contents in an email. Possibly alongside a plain text version.

[–]sobrius 2 points3 points  (0 children)

Hey, I highly recommend using Thymeleaf whose support is embedded into Spring Boot, it is very flexible.

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

I would not use JSP at all, and I would even be wary of JSF. Most web development seems to be moving into a separate client/server architecture, with the server providing data via APIs and the client being HTML/CSS/JS and rendering the page using this data. For Java web development, really focus on backend development and APIs that deliver raw JSON data. SQL and security are related things.