TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

3 点作者 throwaway13000超过 5 年前
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.<p>Is Spring still a good option for this? Which Java framework has good templating support?

3 条评论

SavageBeast超过 5 年前
If By &quot;Templating&quot; 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.<p>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.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;JavaServer_Pages" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;JavaServer_Pages</a><p>To do this you will need a runtime container like Apache Tomcat. ( <a href="http:&#x2F;&#x2F;www.tutorialspoint.com&#x2F;articles&#x2F;run-your-first-jsp-program-in-apache-tomcat-server" rel="nofollow">http:&#x2F;&#x2F;www.tutorialspoint.com&#x2F;articles&#x2F;run-your-first-jsp-pr...</a>)<p>If you&#x27;re hell bent on running Spring ( its entirely not necessary ) you can use Spring MVC which is part of Spring Framework.<p>Here&#x27;s an example <a href="https:&#x2F;&#x2F;www.mkyong.com&#x2F;spring-mvc&#x2F;spring-mvc-hello-world-example&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.mkyong.com&#x2F;spring-mvc&#x2F;spring-mvc-hello-world-exa...</a>
评论 #21034449 未加载
评论 #21031719 未加载
spazbob超过 5 年前
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超过 5 年前
To me, this is more of a religious war than anything that has an objective answer, but I&#x27;ll share my opinion for what it&#x27;s worth.<p>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&#x27;re building an SPA and using fancy JS frameworks where most of the application lives in Javascript-land, then that might change the picture.
评论 #21031841 未加载