Saumya Majumder
Saumya Majumder

Reputation: 15

Is the struts 2 framework already included in Tomcat 7.0.x?

Actually my client asked me to give him the following support:

Now I run an Apache server, I also read that struts 2 framework is by default included in Tomcat 4.0+

Is it true? I mean If I install Tomcat 7.0.x in my server do I have to do anything else to make it capable with struts 2 framework?

I don't have much knowledge in this matter.

Upvotes: 0

Views: 1559

Answers (2)

chad
chad

Reputation: 7519

No, Struts 2 is certainly not included in Tomcat. To clarify the landscape . . .

Tomcat is an implementation of the Java Servlet specification. This specification describes an API for doing generic processing of requests to a server, typically http ( web ) requests. So, the servlet API has low level classes that encapsulate the server's mapping a request URL to a server side resource ( i.e. a servlet that is written in java code ), carrying the request's parameters to that server side resource, and then writing the response that will be returned by the client. The servlet api adds very little higher level functionality. Tomcat is an implementation of the servlet specification.

Struts 2 is one, of many, Java "web application frameworks". These frameworks are written on top of the Servlet API and provide lots of re-useable bells and whistles to the developer who wants to write a "web application". These bells and whistles include stuff like validating your incoming data, providing a clean separation of concerns between the view layer and the java code ( jsp or velocity templates ), and more!

You wouldn't want to see Tomcat including Struts 2 because you might not want to use Struts 2. You might decide to use Spring's web framework, Grails, or one of the many choices.

Upvotes: 1

Pigueiras
Pigueiras

Reputation: 19356

If you want to deploy a Struts2 application in Tomcat, you have to build a war with the project and then put it in the webapps directory of Tomcat. In the war you have to include the necessary libraries of Struts2 because they are not included by default in Tomcat.

Upvotes: 2

Related Questions