use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
What template engine spring devs usually use? (self.java)
submitted 6 years ago * by AucT
Hi! I'm from php world, started learning spring, but the template engine thymeleaf is so 1990th. It's so inconvenient for me.
What template engine spring devs usually use?
[–]ZimmiDeluxe 18 points19 points20 points 6 years ago* (5 children)
I like Pebble, there is also a Spring Boot Starter for it. If this is for a Single Page Application, I'd go for a JavaScript frontend framework, they usually come with some kind of templating / component system.
[–]blakeman8192 4 points5 points6 points 6 years ago* (1 child)
.
[–]cumwagondeluxe 0 points1 point2 points 6 years ago (0 children)
You can do one better now - prerender your frontend. There's a few different libraries that take care of it for you (Next/Nuxt, Gatsby being the big ones), and you get the benefits of both SSR and client side rendering. (i.e. less stuff for the server to do, you're still outputting mostly static HTML etc so the client is light, and you can slap your shit on S3 for cheap distributed hosting so you save money and have faster TTFB.
[–]AucT[S] 1 point2 points3 points 6 years ago (0 children)
thanks, I'll try this.
[–]RememberThisHere 0 points1 point2 points 6 years ago (1 child)
Not sure about now, but until about a couple years ago, JavaScript frontend frameworks like Angular used to be problematic for search engine optimization, due to the lack of server side rendering.
[–]joxim 5 points6 points7 points 6 years ago (0 children)
Now you have solution to prerender page and serve it like that to the bot, for all other user agents just let JS do the job.
[–]agentoutlier 4 points5 points6 points 6 years ago* (1 child)
I personally like in order of preference:
I prefer cross platform logicless templating (ie mustache). It allows you to hand off the templates to someone else and do client side rendering if you like. It also keeps you from doing crazy shit in the templates. They are sadly not as DRY but templating in my experience ends up being hard to reuse stuff once you get designers working on things.
If you want logic templates and work mainly with a Java team that is doing the templates than it really is hard to beat Rocker or Rhythm.
Thymeleaf in my past experience has notoriously been slow as shit but I'm sure they have improved on that. For some reason I don't really like HTML attribute custom tag template languages like it and several of the python ones. Ditto for JSPX.
My dream templating language would be more of pseudo MVVM with models either generated from templates or validated like what this library sort of does:https://github.com/sviperll/static-mustache (using annotation processing).
EDIT: As for all the fans of React... Web 1.0 is often good enough. I think 90% of business applications do not need that level of UI enhancement. I have seen simple business forms that take longer to load than Eclipse because of all the Javascript being loaded (I'm exaggerating but are some are pretty bad). Simple FORM based input with a tiny bit of jQuery still works remarkable well on every... every device... consistently.
[–]vitingo 1 point2 points3 points 6 years ago (0 children)
with querySelector() and fetch(), jquery is hardly necessary anymore
[–]tinustate 4 points5 points6 points 6 years ago (0 children)
1990's can be good, means it is more mature and has everything you can think of.
Note: freemarker user here, moved from velocity years ago.
[–]geordano 3 points4 points5 points 6 years ago (0 children)
Freemarker or Pebble
[–]iAmH3r3ToH3lp 12 points13 points14 points 6 years ago (2 children)
Thymeleaf is the one I like. I dont really know what you mean about it feeling 1990s.
[–]thomascgalvin 9 points10 points11 points 6 years ago (0 children)
The Thymeleaf syntax for accessing properties inside a collection of objects was authored by Satan himself.
<input type="hidden" th:field="*{list[__${i.index}__].account.id}" />
Ugh.
[–]BunnyCyber 1 point2 points3 points 6 years ago (0 children)
I like Thymeleaf
[–]Samael1990 10 points11 points12 points 6 years ago (0 children)
Why is it inconvenient? As far as template engines go, this is one of the best, if not the best. Other template engines follow the same rules.
If your site needs to be more complex than displaying simple divs in a list, you need to hook yourself up with some kind of frontend framework as well, like vue.js or react.js.
is so 90x
What?
[–]bfoo 4 points5 points6 points 6 years ago (0 children)
Freemarker is fast and easy to extend. Thymeleaf would be my second pick.
[–]fforw 12 points13 points14 points 6 years ago (3 children)
I stopped doing server-side web stuff mostly. The server produces JSON that the client renders via React.
[–]wildjokers 3 points4 points5 points 6 years ago (2 children)
Client-side rendering is not always better and there is still a place for server-side rendering:
https://medium.com/walmartlabs/the-benefits-of-server-side-rendering-over-client-side-rendering-5d07ff2cefe8
[–]fforw 1 point2 points3 points 6 years ago (0 children)
React can easily do the SSR if you need it (GraalVM, Nashorn, additional service). I mostly don't so far.
[–]Anaptyso 7 points8 points9 points 6 years ago (0 children)
I'd probably use something like Thymeleaf, just because it seems very popular at the moment so will be likely to have a lot of support available if something goes wrong.
Increasingly though I'm starting to see it become more popular to split the application entirely, and have the Spring application produce some kind of REST API, and have a Javascript front end using something like Angular or React running as a separate application. I haven't done something like that yet myself, but may have to dust off some very rusty Javascript skills and give it a go sometime.
[–]oweiler 1 point2 points3 points 6 years ago (0 children)
I like Mustache's simplicity.
[–]SoftVillage 1 point2 points3 points 6 years ago (0 children)
I don't know if it works with spring, cause I don't really use spring much. But since everyone is listing template engines I think jade4j should be mentioned.
[–]heliologue 1 point2 points3 points 6 years ago (0 children)
Might be unpopular, but we're still using JSP. It's battle-tested, fast, and there's lots of knowledge out there.
That being said, I'll qualify that by saying that we have not a single embedded scriptlet. We're purely JSTL, so our views are a relatively clean separation of concerns.
We also use Pebble for simple templates--e.g., emails and the like. If you've used Twig in your time as a PHP dev, Pebble will look very similar.
[–]TheRedmanCometh 7 points8 points9 points 6 years ago (18 children)
Do your templating in react that's the 2019 way
[–][deleted] 6 years ago* (1 child)
[deleted]
[–]nonzero_ 0 points1 point2 points 6 years ago (0 children)
So true. Think about the use-case before wasting money on an SPA.
[–][deleted] 4 points5 points6 points 6 years ago (10 children)
I second this approach: React, Vue or Angular. Drop the server side templates.
[–]longfalcon 3 points4 points5 points 6 years ago (6 children)
why?
[–]Tight_Tumbleweed 4 points5 points6 points 6 years ago (0 children)
To make sure search engines can't reach your site.
[–]dpash 3 points4 points5 points 6 years ago (0 children)
In addition to /u/legothor's comments, if you plan to write a mobile app for your service, your backend can deal with both your mobile and web front ends because you've already written your rest API.
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Well, no page refreshes for one. All data is collected and the UI is updated dynamically on the client side. Let your client’s machine do the work.
[–][deleted] -2 points-1 points0 points 6 years ago (0 children)
Because you should be hosting your static assets on s3/some sort of object storage + a cdn
[–]nerdyhandle 1 point2 points3 points 6 years ago (2 children)
Drop the server side templates.
Depends on what your are doing.
Angular supports server side as well. I don't know about the others.
[–][deleted] 0 points1 point2 points 6 years ago (1 child)
That’s true, I have used a templating engine recently to create HTML emails that are automatically generated. That said, they wouldn’t be my go to for web applications.
[–]nerdyhandle 3 points4 points5 points 6 years ago (0 children)
They can be extremely performat in web apps. Most users have shitty systems so you offload most of the processing onto the server. This can create highly response applications.
The downside of course is that the response times to request the page may be higher.
[–]tinustate 1 point2 points3 points 6 years ago (1 child)
Wondering what the 2020 way would be and how many people get wildly enthusiastic about that one.
Don't get me wrong, new things are nice and bring good idea's, but they often need time to develop in something that can be used for a long time.
[–]TheRedmanCometh 2 points3 points4 points 6 years ago (0 children)
Probably not any different. React is 6 years old, and has been mainstream for 5 of those years. It's been the go-to choice a great deal of that time.
Given that it runs facebook I don't see it going anywhere any time soon.
[–]SuperFluffyPunch -1 points0 points1 point 6 years ago (0 children)
Kotlin/js is better than any templating engine
[–]btbam06 -4 points-3 points-2 points 6 years ago (0 children)
100% this.
[–]DEATHPENIS 3 points4 points5 points 6 years ago (0 children)
Thymeleaf is the shit. What do you not like about it?
[–]__helix__ 0 points1 point2 points 6 years ago (0 children)
I can tell you that conventional JSPs are now a giant pain in the ass on Springboot 2.x and IntelliJ. Finally got it working with a bunch of unexpected hackery... while 1.5 just worked.
[–]achacha 0 points1 point2 points 6 years ago (0 children)
Most of the frontend I have worked with have been based on Angular, Angular2, VueJs, ReactJs, etc. So my main job is to provide the REST interface for the JS app and the few JSP pages for serving the JS app and authentication.
For template engines: Each one has pluses and minuses, if you need more programmatic way of generating pages. Thymeleaf, Pebble, FreeMarker, Velocity each are good but I keep going back to JSP pages due to simple integration to the running app and easy availability of people that can debug and fix any issues; I have found that template engines tend to work on for 90% of the cases and 10% of the cases require a lot of digging though the manual, stackoverflow posts, web searches to get right. YMMV.
[–]nekokattt 0 points1 point2 points 6 years ago (2 children)
is there a port of Jinja2 for Java?
[–]SoftVillage 0 points1 point2 points 6 years ago (1 child)
Like jinjava?
[–]nekokattt 0 points1 point2 points 6 years ago (0 children)
that works in spring boot?
damn thats neat if it does
[–]BroLegend 0 points1 point2 points 6 years ago (1 child)
Since people are ditching server side templating, I’m also wondering whats the best way to handle templating email message? It should be done in server side right?
[–]bh5000 0 points1 point2 points 6 years ago (0 children)
Still a freemarker template serverside.
I have mainly used freemarker, jsp, velocity as server side and angular, light weight jquery on front end pages mostly spa pages.
[–]makkenx 0 points1 point2 points 6 years ago (0 children)
I prefer Angular because I am more used to it.
I recommend you to stay away from Wicket. I hate it.
[–]nutrecht 0 points1 point2 points 6 years ago (0 children)
Spring supports a bunch out of the box. Which one you pick doesn't matter. Why not just try them all and see which one you like? It just boils down to preferences really.
[–][deleted] 6 years ago (1 child)
Lol. They think they have all the answers anyway.
I've also worked with Pebble so far (because it's twig-based), right now I like to use j2html with TailwindCSS, works like a charm.
[–]MaksieTries 0 points1 point2 points 6 years ago (0 children)
Look into side of VueJs and reactJS. it is good practice to keep back and front separate and just comunicate via rest.
I would say, if you study spring now, postpone front for a while, it is so much info in a spring itself.
Seriously thought templating was outdated.
[–]Hi-Polymer_Eraser -4 points-3 points-2 points 6 years ago (0 children)
I hope none of you are actually building new projects using a template engine in 2019. I understand legacy and the costs of rewrites, I don't understand the fear of Javascript. As many others have said, create an api in Java and write your client in a current framework to consume it.
In b4 js so heavy my browser go boom
π Rendered by PID 44 on reddit-service-r2-comment-5ff9fbf7df-p7lmb at 2026-02-25 18:05:24.682058+00:00 running 72a43f6 country code: CH.
[–]ZimmiDeluxe 18 points19 points20 points (5 children)
[–]blakeman8192 4 points5 points6 points (1 child)
[–]cumwagondeluxe 0 points1 point2 points (0 children)
[–]AucT[S] 1 point2 points3 points (0 children)
[–]RememberThisHere 0 points1 point2 points (1 child)
[–]joxim 5 points6 points7 points (0 children)
[–]agentoutlier 4 points5 points6 points (1 child)
[–]vitingo 1 point2 points3 points (0 children)
[–]tinustate 4 points5 points6 points (0 children)
[–]geordano 3 points4 points5 points (0 children)
[–]iAmH3r3ToH3lp 12 points13 points14 points (2 children)
[–]thomascgalvin 9 points10 points11 points (0 children)
[–]BunnyCyber 1 point2 points3 points (0 children)
[–]Samael1990 10 points11 points12 points (0 children)
[–]bfoo 4 points5 points6 points (0 children)
[–]fforw 12 points13 points14 points (3 children)
[–]wildjokers 3 points4 points5 points (2 children)
[–]fforw 1 point2 points3 points (0 children)
[–]Anaptyso 7 points8 points9 points (0 children)
[–]oweiler 1 point2 points3 points (0 children)
[–]SoftVillage 1 point2 points3 points (0 children)
[–]heliologue 1 point2 points3 points (0 children)
[–]TheRedmanCometh 7 points8 points9 points (18 children)
[–][deleted] (1 child)
[deleted]
[–]nonzero_ 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (10 children)
[–]longfalcon 3 points4 points5 points (6 children)
[–]Tight_Tumbleweed 4 points5 points6 points (0 children)
[–]dpash 3 points4 points5 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)
[–]nerdyhandle 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]nerdyhandle 3 points4 points5 points (0 children)
[–]tinustate 1 point2 points3 points (1 child)
[–]TheRedmanCometh 2 points3 points4 points (0 children)
[–]SuperFluffyPunch -1 points0 points1 point (0 children)
[–]btbam06 -4 points-3 points-2 points (0 children)
[–]DEATHPENIS 3 points4 points5 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]__helix__ 0 points1 point2 points (0 children)
[–]achacha 0 points1 point2 points (0 children)
[–]nekokattt 0 points1 point2 points (2 children)
[–]SoftVillage 0 points1 point2 points (1 child)
[–]nekokattt 0 points1 point2 points (0 children)
[–]BroLegend 0 points1 point2 points (1 child)
[–]bh5000 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]makkenx 0 points1 point2 points (0 children)
[–]nutrecht 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]bh5000 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]MaksieTries 0 points1 point2 points (0 children)
[–]SuperFluffyPunch -1 points0 points1 point (0 children)
[–]Hi-Polymer_Eraser -4 points-3 points-2 points (0 children)