Below is a clear, structured, and in-depth discussion of Struts – Understanding the Basic Architecture of Model, View, and Controller (MVC), written in a theoretical + flow-oriented manner, suitable for strong conceptual understanding.
Struts Framework: MVC Architecture (Model–View–Controller)
Introduction
The Struts framework is built entirely around the Model–View–Controller (MVC) architectural pattern. The main objective of MVC in Struts is to separate concerns, meaning the presentation logic, business logic, and request-handling logic are kept independent of each other. This separation makes applications easier to develop, test, maintain, and scale.
In Struts, MVC is implemented in a well-defined and centralized manner, where each component has a specific responsibility.

Overview of MVC in Struts
| Component | Responsibility |
|---|---|
| Model | Business logic and data |
| View | User interface |
| Controller | Request handling and navigation |
Struts acts as a bridge that coordinates communication between these three layers.
1. Model in Struts
Meaning
The Model represents the business logic and data layer of the application. It is responsible for:
- Processing data
- Interacting with databases
- Applying business rules
- Returning results to the controller
Components of Model in Struts
The Model layer typically consists of:
- JavaBeans
- POJOs (Plain Old Java Objects)
- Service classes
- DAO (Data Access Object) classes
Role of Model
- Contains no presentation logic
- Independent of Struts framework
- Reusable across different applications
- Handles data validation at business level
Example Responsibilities
- User authentication logic
- Database CRUD operations
- Calculations and validations
- Business rule enforcement
📌 In Struts, the Model never directly interacts with JSP pages.
2. View in Struts
Meaning
The View represents the presentation layer of the application. It is responsible for:
- Displaying data to users
- Collecting user input
- Showing responses and messages
Components of View
The View layer is implemented using:
- JSP pages
- Struts tag libraries
- HTML and CSS
Role of JSP in View
- Displays output received from the controller
- Uses Struts tags to avoid Java code in JSP
- Focuses only on UI and formatting
Struts Tag Libraries
Struts provides custom tags such as:
<html:form><html:text><html:errors><bean:write>
These tags:
- Reduce scripting code
- Improve readability
- Simplify form handling
📌 View does not contain business logic.
3. Controller in Struts
Meaning
The Controller is the core of the Struts framework. It manages:
- Client requests
- Request routing
- Action invocation
- Navigation control
Front Controller Concept
Struts uses a Front Controller pattern, where all requests are handled by a single controller.
- Struts 1:
ActionServlet - Struts 2:
FilterDispatcher/StrutsPrepareAndExecuteFilter
Responsibilities of Controller
- Receive HTTP requests
- Identify requested action
- Call appropriate Action class
- Interact with Model
- Decide which View to display
Action Class (Controller Logic)
Role of Action Class
- Acts as a mediator between View and Model
- Contains request-processing logic
- Calls business methods of Model
- Returns navigation outcome
Flow Inside Action Class
- Receive form data
- Validate input
- Call Model methods
- Store results
- Forward to appropriate JSP
ActionForm (Struts 1 Only)
Purpose
- Holds form input values
- Automatically populated by Struts
- Acts as a data carrier between View and Controller
📌 In Struts 2, ActionForm is removed and replaced by POJOs.
Request Processing Flow in Struts MVC
- Client submits request from browser
- Request reaches Front Controller
- Controller checks configuration file
- Appropriate Action class is identified
- Action interacts with Model
- Result is returned to Controller
- Controller forwards to View (JSP)
- JSP renders response to client
Interaction Between MVC Components
| From | To | Purpose |
|---|---|---|
| View | Controller | Sends user request |
| Controller | Model | Requests business processing |
| Model | Controller | Returns processed data |
| Controller | View | Selects response page |
📌 Direct interaction between View and Model is avoided.
Benefits of MVC Architecture in Struts
- Clear separation of concerns
- Easier maintenance and debugging
- Reusable and testable components
- Improved scalability
- Better team collaboration
Limitations of MVC in Struts
- Steep learning curve
- Heavy configuration (especially Struts 1)
- Controller can become complex
- Slower development compared to modern frameworks
Conclusion
The MVC architecture in Struts provides a structured and disciplined approach to Java web application development. By clearly separating the Model, View, and Controller, Struts ensures that applications are modular, maintainable, and scalable. The controller-centric design, combined with reusable models and JSP-based views, makes Struts a powerful framework, especially for large and enterprise-level web applications.
