Introduction and Working of Struts Web Framework

Struts is an open-source web application framework developed by Apache Software Foundation, it is used to create a web application based on servlet and JSP. It depends on the MVC (Model View Controller) framework. Struts are thoroughly useful in building J2EE (Java 2 Platform, Enterprise Edition) applications because struts take advantage of J2EE design patterns. Struts follows these J2EE design patterns including MVC and JSP custom tag libraries. In struts, the composite view manages the layout of its sub-views and can implement a template, making persistent look and feel easier to achieve and customize across the entire application. A composite view is made up by using other reusable sub-views such that a small change that happens in a sub-view is automatically updated in every composite view. Struts consist of a set of custom tag libraries. Struts also support utility classes.

The main purpose of the struts framework is to provision separation of concerns between the business logic and the presentation logic (view), making it easier to manage and develop large-scale web applications.

Features of Struts

Struts have the following features:

Working of Struts:

Working Flow of Struts

Step-by-Step Implementation of Struts

Step 1: Initialization Phase

Step 2: Composition of Configuration file

Step 3: Routing of HTTP Requests & process flow

Step 4: Action object request handling

The action object can indirectly forward one or more shared objects, these shared objects can be JavaBeans, and are typically shared in shared context which is established using Java Servlets.