Apache Struts 和 Java EE 的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1636238/
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
Difference between Apache Struts and Java EE?
提问by Catfish
I'm currently learning Java EE, or more specifically, Servlets and .jsp. In my programming, I already employ the Model-View-Controller model to write my code. And as far as I've googled, Apache Struts is just a server like Tomcat. So, what exactly is Apache Struts, in relation to Java, Java EE, and Servlet classes in Java EE?
我目前正在学习 Java EE,或者更具体地说,Servlets 和 .jsp。在我的编程中,我已经使用模型-视图-控制器模型来编写我的代码。就我在谷歌上搜索过的而言,Apache Struts 只是一个类似于 Tomcat 的服务器。那么,与 Java、Java EE 和 Java EE 中的 Servlet 类相关的 Apache Struts 究竟是什么?
回答by Vincent Ramdhanie
Struts is NOT another server. It's an application framework. It is built on top of JSP and Servlet architecture. So it is an abstraction of the servlet environment.
Struts 不是另一台服务器。它是一个应用程序框架。它建立在 JSP 和 Servlet 架构之上。所以它是servlet环境的抽象。
Using a framework like Struts has some advantages such as: many common features of applications are pre-built so you don't have to do them yourself. Features such as validation. It also forces you to work according to some best practice philosophy, in this case MVC.
使用像 Struts 这样的框架有一些优点,例如:应用程序的许多常见功能都是预先构建的,因此您不必自己动手。验证等功能。它还迫使您根据一些最佳实践哲学工作,在这种情况下是 MVC。
Under the covers Struts implement a few servlets to do the job. You the developer do not have to write servlets. You can focus on business logic instead.
在幕后,Struts 实现了一些 servlet 来完成这项工作。您开发人员不必编写 servlet。您可以专注于业务逻辑。
回答by McDowell
Struts is a library for making web applications; it is not by itself a server. It requires a JSP/Servlet container in order to work (such as Tomcat). See the Struts technology primer.
Struts 是一个用于制作 Web 应用程序的库;它本身不是服务器。它需要一个 JSP/Servlet 容器才能工作(例如 Tomcat)。请参阅Struts 技术入门。
Java EEis a specification that includes a number of technologies. Tomcat is not a Java EE server because it does not incorporate all these technologies, but has been used as part of a Java EE server, providing the web tier.
Java EE是一个包含多种技术的规范。Tomcat 不是 Java EE 服务器,因为它没有包含所有这些技术,而是用作 Java EE 服务器的一部分,提供 Web 层。

(source: sun.com)

(来源:sun.com)
回答by skaffman
维基百科:
Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture.
Apache Struts 是用于开发 Java EE Web 应用程序的开源 Web 应用程序框架。它使用并扩展了 Java Servlet API,以鼓励开发人员采用模型-视图-控制器 (MVC) 架构。

