Difference between Apache Struts and Java EE?
Asked Answered
L

3

5

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?

Lucrecialucretia answered 28/10, 2009 at 10:0 Comment(0)
S
6

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.

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.

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.

Scuba answered 28/10, 2009 at 10:32 Comment(0)
V
5

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.

Java EE is 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.

basic architecture JEE diagram
(source: sun.com)

Vedanta answered 28/10, 2009 at 10:33 Comment(0)
D
0

Wikipedia:

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.

Daffi answered 28/10, 2009 at 10:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.