Struts Overview

Apache Struct 2 is an open source framework to build Java Enterprise Edition web applications. It is based on Model View Controller (MVC) design pattern. Action, Interceptors, ValueStack, OGNL are important features of Struts 2.

Struts 2 is the combination of webwork framework of opensymphony and struts 1.

Model View Controller

It is a very well known design pattern to develop web application.

Model → This is responsible for maintaining data. e.g. bean or model class.

View → It is a representation of the end result to output or show on the on the page. e.g. JSP, HTML etc.

Controller → Controller is a backend code which gets trigger on performing any action or user input.

The browser will call the controller as shown in the below inline diagram. The controller will decide whether to call view or model.

1st Scenario → The browser will call the controller and, depending on input data, the model will call the database as it is tightly coupled using JPA or Hibernate. On getting a response back from the database, the model will call view to output data on the browser output screen.

2nd Scenario → The browser will call the controller and, depending on the input data, the view will call the database as it is tightly coupled using JPA or Hibernate. On getting a response back from the database, the view will output data on the browser output screen.

Mode can get request to return data from both View and Controller.

Imran Khan

Specialist Master (Architect) with a passion for cutting-edge technologies like AEM (Adobe Experience Manager) and a proven track record of delivering high-quality software solutions.

  • Languages: Java, Python
  • Frameworks: J2EE, Spring, Struts 2.0, Hibernate
  • Web Technologies: React, HTML, CSS
  • Analytics: Adobe Analytics
  • Tools & Technologies: IntelliJ, JIRA

🌐 LinkedIn

📝 Blogs

📧 Imran Khan