In this video tutorial we will explain you the features, benefits and architecture of the Struts 2 Framework. The Struts 2 framework is very elegant framework for developing web applications. Applications developed in Struts 2 is very extensible and maintainable; which can be used to develop applications of any size.
Welcome to the world of web application development using Struts 2 Framework.
In this video tutorial I will teach you the Struts 2 framework. You will learn the basics of Struts 2 framework. We will explain you how you can create your first application using Struts 2.3.8 framework. We are using Struts 2.3.8 framework for this tutorial.
Here is the video tutorial of Struts 2 Framework Introduction.
In this session I will explain you the basics of Struts 2 framework and then teach you how to develop your first application using Struts 2 frame work. Topics covered in this session are:
We will use the Eclipse IDE development of the example application and Tomcat 7 for deploying the application.
Introduction to the Struts 2 framework.
Comparison between Struts 1 and Struts 2 frameworks.
Feature |
Struts 1 |
Struts 2 |
Action classes |
Struts1 extends the abstract base class by its action class. The problem with struts1 is that it uses the abstract classes rather than interfaces. |
Struts 2 provides a base ActionSupport class that implements commonly used interfaces. Although an Action interface is not necessary, any POJO object along with an execute signature can be used as an Struts 2 Action object. |
Action Form |
ActionForm class is mandatory in Struts 1 |
In Struts 2 same action class is used to hold the form data. |
ActionForward |
ActionForward is class in Struts 1. |
In Struts 2 action returns a string value which is called “Result”. |
Struts Configuration |
In Struts 1 struts-config.xml is used for configuring the application. |
In Struts 2 struts.xml file is used for the application configuration. |
Controller |
In Struts 1 ActionServlet works as the controller. |
In the latest version of Struts 2, StrutsPrepareAndExecuteFilter is used as the controller of the application. |
Request processing |
In Struts 1 RequestProcessor is used for pre and post processing of the request. |
In Struts 2 Interceptors are used for pre and post processing of the request. |
Struts 2 Architecture
Struts 2 is an action based framework. It is based on the popular MVC Architecture. The MVC design patterns provides a clean separation of objects into three categories; Model, View and Controller.
Controller: Controller Controls the events passed between Model and the View. All the user request passes through the controller. In Struts all the user requests passes through the controller. Controller is responsible for handling all the requests from the user and finally calling appropriate action.
Model: Model represents the business data. Holds and manages application data such as database data, session data etc..
View: This is the data presentation or the view to be displayed to the user.
Request Lifecycle in Struts 2 applications
Step to develop applications:
In the next video tutorial I will teach you how to develop Hello World application in Struts 2.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Introduction to Struts 2 Framework
Post your Comment