







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An introduction to the model-view-controller (mvc) architecture and the apache struts framework in the context of web-based commerce. Mvc is an architectural pattern that separates the presentation, application logic, and resource management layers, while apache struts is an open-source framework for creating java web applications. The basics of mvc, its implementation in various frameworks, and the role of apache struts in mvc-based web development.
Typology: Study notes
1 / 13
This page cannot be seen from the preview
Don't miss anything!
Dr Kingsley Sage Room 2R308, Chichester II khs20@sussex.ac.uk © University of Sussex 2007
The Model View Controller (MVC) architecture Introducing the Struts framework
Design patterns
Design patterns
Model: The domain specific representation on which the application operates View: Renders the model into a form suitable for interaction, typically a user interface. MVC is often seen in web applications, where View is the HTML page and the code which gathers dynamic data for the page Controller: Processes and responds to events, typically user actions and may invoke changes on the Model and View
MVC has inspired many frameworks, including:
In ASP.NET the patterns for the View and Controller are well defined. The Model is left to the developer to design
Struts can be considered an industrial strength framework suitable for large applications, but not yet a standard Main attraction is that developers can make use of configurable application components (e.g. Controller servlet) that come with the distribution Whole application held together with XML configuration file called struts-config.xml (stored in the app’s WEB-INF directory)
Struts provides a robust infrastructure for Model 2 application development using the Front Controller and Service-To-Worker design patterns View portion is most often constructed using Java Server Pages. JSP can contain static HTML text, plus the ability to insert dynamic content based on the run time interpretation of special action tags. There is a set of standard tags and you can add your own tags in custom tag libraries
Struts provides the Controller part of the application. Controller receives requests from the user, decides what business logic needs to be performed and then delegates responsibility for producing the next phase of the user interface to an appropriate View component Primary component is a servlet of class ActionServlet Servlet is configured by defining ActionMappings ActionMapping defines a path matched against the request URI and specifies fully qualified class name of an Action class All Actions sub-classed from org.apache.struts.action.Action
Typical control flow:
Taken from www.allapplabs.com/struts/
Lab sheet 1 is a short programming exercise working with the Struts framework You do not need to become a Struts expert – you will be likely using some of it in coursework 2 It’s just to get you used to the ideas of a framework and the functionality they provide in the context of a well regarded product See the course web site for the lab sheet
Transaction processing Databases for back end systems MySQL Using Java Data Base Connectivity (JDBC)