Java 的最佳 Web 应用程序框架?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/257712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 12:06:45  来源:igfitidea点击:

Best Web applications framework for Java?

javamodel-view-controllerweb-frameworks

提问by ashokgelal

Which is the best framework for Java? I'm looking for something similar to Symfony for php and Ruby-On-Rails for Ruby? I even don't know if anything such exists for Java or not.

哪个是 Java 的最佳框架?我正在寻找类似于 Symfony for php 和 Ruby-On-Rails for Ruby 的东西?我什至不知道 Java 是否存在这样的东西。

采纳答案by Steve K

There are many great web frameworks for java, but if your looking for something that is similar to Rails, look at Grails. It uses Groovy, which is dynamic language, but uses the Java VM.

有许多很棒的 Java 网络框架,但是如果您正在寻找类似于 Rails 的东西,请查看Grails。它使用Groovy,这是一种动态语言,但使用 Java VM。

Check out their quick startto determine if it's what you want.

查看他们的快速入门以确定它是否是您想要的。

回答by TM.

Strutsis for suits.

Struts适用于西装。

回答by Tim Howland

I agree with the other folks who are suggesting grails- I'm using it on a couple of apps now, and it's the closest thing I've found to a java flavored ruby on rails. That said, why not use JRuby? My understanding is that they have Rails running on it now.

我同意其他建议使用 grails 的人的看法——我现在在几个应用程序上使用它,这是我发现的最接近 Java 风格的 ruby​​ on rails 的东西。也就是说,为什么不使用 JRuby?我的理解是他们现在已经在运行 Rails。

回答by Hyman Leow

I'm not sure if you're being sarcastic or not, but if you're not here's a partial list of Java Web Frameworks:

我不确定你是不是在讽刺,但如果你不是,这里是 Java Web 框架的部分列表:

  1. Java Server Faces (official Sun spec), various implementations are available
  2. Apache Struts
  3. Apache Shale
  4. Apache Tapestry
  5. Apache Wicket
  6. OpenSymphony WebWork
  7. Spring Framework MVC
  1. Java Server Faces(Sun 官方规范),各种实现可用
  2. Apache Struts
  3. 阿帕奇页岩
  4. 阿帕奇挂毯
  5. 阿帕奇检票口
  6. 打开Symphony WebWork
  7. Spring 框架 MVC

Having only used a few of these, I can't really tell you which one is the best. Spring MVC is my personal favorite for more content oriented sites, but I'd use JSF if it's more the traditional web application (application with a web interface).

只使用了其中的几个,我真的不能告诉你哪一个是最好的。对于更多面向内容的站点,Spring MVC 是我个人的最爱,但如果它更像是传统的 Web 应用程序(具有 Web 界面的应用程序),我会使用 JSF。

The joke amongst Java developers, generally, isn't ifthere's a framework/library for a certain application, but which of the dozens of options to use.

Java 开发人员之间的笑话通常不是某个应用程序是否有框架/库,而是要使用的几十个选项中的哪一个。

回答by Pablo Marambio

Tapestry looks very cool... after you have made a BIG effort to install it.

Tapestry 看起来很酷……在您付出巨大努力安装它之后。

回答by Marc Bollinger

It depends on what you want to do, but the short answer is: boy, are there! Note, however, that answer does not indicate whether the myriad of options is good or bad. Java's server side community tends to be a lot more fragmented, and while there aren't that many alternatives to Rails used in actual practice for Ruby, each of the camps on the Java side seem to be fairly well manned. As Taylor Marshall mentioned, there's Struts, which is used most often in industry (as it's the oldest still-in-use OSS MVC container I know of. But no one seems to like Struts anymore. The Ex-Jakartamenu on the Apache Jakarta page shows a number of Web Application frameworks that they've incubated, including Tapestry, Turbine, and Velocity. There's also Wicket(a very decent comparison of Wicket and Tapestry is available here). Oh, and Java Server Faces. And SpringMVC. Tapestry and Wicket (in particular) seem to be gaining ground, while everyone seems to have a horror story about JSF. Your mileage will absolutely vary here, and eesh, looking up at the links in just this answer, maybe Groovy would be simpler.

这取决于你想做什么,但简短的回答是:男孩,在那里!但是请注意,该答案并不表明无数选项是好是坏。Java 的服务器端社区往往更加分散,虽然在 Ruby 的实际实践中使用的 Rails 替代品并不多,但 Java 端的每个阵营似乎都相当有人情味。正如 Taylor Marshall 提到的,有 Struts,它在工业中最常用(因为它是我所知道的最古老的仍在使用的 OSS MVC 容器。但似乎没有人喜欢 Struts。Apache Jakarta上的Ex-Jakarta菜单页面显示了他们孵化的许多 Web 应用程序框架,包括TapestryTurbineVelocity. 还有Wicket此处提供了 Wicket 和 Tapestry 的非常不错的比较)。哦,还有Java Server Faces。和 SpringMVC。Tapestry 和 Wicket(尤其是)似乎正在取得进展,而每个人似乎都有一个关于 JSF 的恐怖故事。您的里程在这里绝对会有所不同,而且 eesh,查看此答案中的链接,也许 Groovy 会更简单。

回答by Jeduan Cornejo

I read about JBoss Seam and it seems nice too

我读过关于 JBoss Seam 的文章,它看起来也不错

回答by Georgy Bolyuba

Take a look at Spring. I think it will do anything Ruby-On-Rails can do (you can also add Hibernate for ORM).

看看春天。我认为它可以做任何 Ruby-On-Rails 可以做的事情(你也可以为 ORM 添加 Hibernate)。

回答by matt b