DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Beyond Request-Response: Architecting Stateful Agentic Chatbots with the Command and State Patterns
  • Cost Is a Distributed Systems Bug
  • A General Overview of TCPCopy Architecture
  • What Are Events? API Calls

Trending

  • Amazon OpenSearch Vector Search Explained for RAG Systems
  • Is the Data Warehouse Dead? 3 Patterns From Enterprise Architecture That Answer This Question
  • How to Interpret the Number of Spring ApplicationContexts in Integration Tests
  • Metal Default, a New Build Cloud, and a New Format
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. Struts MVC Architecture Tutorial

Struts MVC Architecture Tutorial

By 
Meyyappan Muthuraman user avatar
Meyyappan Muthuraman
·
Jun. 13, 12 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
249.6K Views

Join the DZone community and get the full member experience.

Join For Free

The model contains the business logic and interact with the persistance storage to store, retrive and manipulate data.

The view is responsible for dispalying the results back to the user. In Struts the view layer is implemented using JSP.

The controller handles all the request from the user and selects the appropriate view to return. In Sruts the controller's job is done by the ActionServlet.

The following events happen when the Client browser issues an HTTP request.

  • The ActionServlet receives the request.
  • The struts-config.xml file contains the details regarding the Actions, ActionForms, ActionMappings and ActionForwards.
  • During the startup the ActionServelet reads the struts-config.xml file and creates a database of configuration objects. Later while processing the request the ActionServlet makes decision by refering to this object.

When the ActionServlet receives the request it does the following tasks.

  • Bundles all the request values into a JavaBean class which extends Struts ActionForm class.
  • Decides which action class to invoke to process the request.
  • Validate the data entered by the user.
  • The action class process the request with the help of the model component. The model interacts with the database and process the request.
  • After completing the request processing the Action class returns an ActionForward to the controller.
  • Based on the ActionForward the controller will invoke the appropriate view.
  • The HTTP response is rendered back to the user by the view component.

 

Requests Architecture

Published at DZone with permission of Meyyappan Muthuraman. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Beyond Request-Response: Architecting Stateful Agentic Chatbots with the Command and State Patterns
  • Cost Is a Distributed Systems Bug
  • A General Overview of TCPCopy Architecture
  • What Are Events? API Calls

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook