最小的 Java Web MVC 框架是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/796219/
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
What's the most minimal Java web MVC framework?
提问by Chris Collins
I'm looking for a Java web framework that requires the most minimal amount of configuration for a very small app. Spring & Struts are definitely overkill here. This is an app that could be written without any framework at all but I would prefer to use a minimal MVC framework if I can find one.
我正在寻找一个 Java Web 框架,它需要为一个非常小的应用程序进行最少的配置。Spring & Struts 在这里绝对是矫枉过正。这是一个完全可以在没有任何框架的情况下编写的应用程序,但如果我能找到一个,我更愿意使用最小的 MVC 框架。
回答by jsight
Stripesand ZTemplatesare supposed to be pretty light.
条纹和ZTemplates应该很轻。
回答by Artyom Sokolov
Take a look on Apache Wicket.
回答by Patrick Cornelissen
I'd say that spring webmvc is pretty minimalistic and IMHO it's far from overkill. You don't have to include the whole spring Framework to do your things. To start a webmvc webapp you need ~3-4 jars IIRC. Don't underestimate the advantages of DI in regard of internal structure and testability.
我会说 spring webmvc 非常简约,恕我直言,它远非矫枉过正。你不必包含整个 spring 框架来做你的事情。要启动一个 webmvc webapp,你需要大约 3-4 个 jars IIRC。不要低估 DI 在内部结构和可测试性方面的优势。
I'd go for Spring WebMVC + JSP maybe combined with sitemesh. Later when you realize that you have more complicated stuff to do you could add Spring-Webflow and so on.
我会选择 Spring WebMVC + JSP 可能与 sitemesh 结合使用。稍后当您意识到您有更复杂的事情要做时,您可以添加 Spring-Webflow 等。
回答by Ray Tayek
grails requires a minimal amount of config since most of it has sane defaults.
grails 需要最少的配置,因为它大部分都有合理的默认值。
回答by jjnguy
The most minimal way to do a Java web app would be to use JSPs to display your content and Just plain Java in the back end.
制作 Java Web 应用程序的最简单方法是使用 JSP 来显示您的内容,并在后端使用纯 Java。
This would require almost no configuration.
这几乎不需要配置。
The only requirements for that is the J2SE and Tomcat for hosting.
唯一的要求是用于托管的 J2SE 和 Tomcat。
回答by topchef
The lightest Java framework would be servlet + JSP. Try to use the latest released standards - Servlet 2.5 and JSP 2.1. Tomcat provides all you need:
最轻量级的 Java 框架是 servlet + JSP。尝试使用最新发布的标准 - Servlet 2.5 和 JSP 2.1。Tomcat 提供您所需要的一切:
- servlet container;
- JSPs (optional);
- Java runtime;
- web server to serve HTMLs.
- servlet 容器;
- JSP(可选);
- Java运行时;
- 用于提供 HTML 的 Web 服务器。
回答by KItis
try appfuce.com. this gives you full functional mvc webapplication based on your preference(struts2, spring or JSF). and it has sample login system implemented so that you will learn the core features of technologies involved
试试 appfuce.com。这会根据您的喜好(struts2、spring 或 JSF)为您提供全功能的 mvc web 应用程序。并实现了示例登录系统,以便您了解所涉及技术的核心功能

