Settings

Theme

Ask HN: Is Spring still a good framework for Java based web projects?

3 points by throwaway13000 6 years ago · 6 comments · 1 min read


I am looking for a Django like framework for java based web project. It is a standard CRUD web-app but I need the project to be in Java because existing libraries are all in Java.

Is Spring still a good option for this? Which Java framework has good templating support?

SavageBeast 6 years ago

If By "Templating" you mean something similar to Smarty or Twig ( facilities to render pages of HTML with conditionals and variables ) then Java is a fine choice for this.

Spring is unnecessary - the Java templating mechanism is called JSP ( Java Server Pages ) and its part of the standard Java package - no additional framework is required.

https://en.wikipedia.org/wiki/JavaServer_Pages

To do this you will need a runtime container like Apache Tomcat. ( http://www.tutorialspoint.com/articles/run-your-first-jsp-pr...)

If you're hell bent on running Spring ( its entirely not necessary ) you can use Spring MVC which is part of Spring Framework.

Here's an example https://www.mkyong.com/spring-mvc/spring-mvc-hello-world-exa...

spazbob 6 years ago

Check out thymeleaf.org - adds HTML templating to Spring MVC. I much prefer the syntax over JSP personally. In addition, the docs are great and there are plenty of resources online (baeldung in particular).

mindcrime 6 years ago

To me, this is more of a religious war than anything that has an objective answer, but I'll share my opinion for what it's worth.

Spring is fine, and I mostly use Spring Boot for API services. But for web stuff, my personal preference is for Grails (which ultimately is still Spring underneath, but with Groovy flavored goodness on top). At least for server-rendered HTML. If you're building an SPA and using fancy JS frameworks where most of the application lives in Javascript-land, then that might change the picture.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection