Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

JSF Portlet Backing Beans and UI Components Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in.
Apache Struts Technology
MVC in JavaEE 8 Manfred Riem Principal Member of Technical Staff September, 2014 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-View-Controller ("MVC") This is a architectural design pattern for interactive applications. This design pattern organizes an interactive application.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
ASP MVC s/mvc-4/getting-started-with- aspnet-mvc4/intro-to-aspnet- mvc-4.
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
Hello Vaadin! CS 3130 Summer 2015.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Apache Struts Technology A MVC Framework for Java Web Applications.
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Struts 2.0 an Overview ( )
Introduction to Struts 2.0 Jenny Ni Joey Feng Winddays Wang Hewmmi Zhu Heather Lv Software School,Fudan University 1.
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
Lecture 2 - Struts ENTERPRISE JAVA. 2 Contents  Servlet Deployment  Servlet Filters  Model View Controllers  Struts  Dependency Injection.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Configuration Management and Server Administration Mohan Bang Endeca Server.
Server-side Scripting Powering the webs favourite services.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Screen Snapshot Service Kurt Biery SiTracker Monitoring Meeting, 23-Jan-2007.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
HTML Project 4 Creating an Image Map.
Instructors begin using McGraw-Hill’s Homework Manager by creating a unique class Web site in the system. The Class Homepage becomes the entry point for.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
Struts 2 introduction. Struts 2 framework Struts 2 A full-featured web application framework for the Java EE platform The Java Servlet API exposes the.
Model View Controller MVC Web Software Architecture.
I Copyright © 2007, Oracle. All rights reserved. Module i: Siebel 8.0 Essentials Training Siebel 8.0 Essentials.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
3 Copyright © 2009, Oracle. All rights reserved. Understanding the Warehouse Builder Architecture.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Model View Controller (MVC) an architecture Rick Mercer with help from many of others 1.
Chapter 9 Web Application Design. Objectives Describe the MVC design pattern as used with Web applications Explain the role and responsibilities of each.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
2 Copyright © 2004, Oracle. All rights reserved. ADF Development Process.
Apache Struts Technology A MVC Framework for Java Web Applications.
2 Copyright © 2004, Oracle. All rights reserved. Running a Forms Developer Application.
Solvency II Tripartite template V2 and V3 Presentation of the conversion tools proposed by FundsXML France.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
ORACLE ADF ONLINE TRAINING COURSE
Warm Handshake with Websites, Servers and Web Servers:
J2EE Lecture 7: Spring – Spring MVC
Unit 6-Chapter 2 Struts.
CS5220 Advanced Topics in Web Programming Spring – Web MVC
The Model Layer What is Model?
Presentation transcript:

Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. Application Delivery Fundamentals 2.0: Java Module 27: Spring MVC

Copyright © 2012 Accenture All Rights Reserved. Module Objectives Describe Model View Controller (MVC) Design Pattern Explain Spring MVC implementation Create a Spring MVC-based application At the end of this module, participants will be able to: 2

Copyright © 2012 Accenture All Rights Reserved. Agenda Model View Controller Design Pattern Spring MVC: vs. Spring Spring MVC Optional Activity 1: Spring MVC 3

Copyright © 2012 Accenture All Rights Reserved. Model View Controller Design Pattern Model Handles the behavior and data of the application View Handles the display of information Interprets the user inputs, informing the model and/or the view to change as appropriate Controller Model View Controller (MVC): A fundamental design pattern for separating user interface logic from business logic Separates the domain (Model), the user interface (View), and the actions based on user input (Controller) into three separate categories: 4

Copyright © 2012 Accenture All Rights Reserved. Spring MVC vs. Spring Earlier versions on Spring (Before 2.5) relied more on xml configurations Spring 2.5 introduced a simplified, annotation-based model for developing Spring MVC applications informally referred to as Spring Framework uses and so on, to mark a class as a Controller or to map a request to its handler respectively 5

Copyright © 2012 Accenture All Rights Reserved. Indicates that a particular class serves the role of a controller. Eliminates the need to extend any Controller base class Request and Response are automatically filled in by Spring MVC 6

Copyright © 2012 Accenture All Rights Reserved. Is used to map URLs like '/userlogin.htm’ to an entire class or a particular handler method. Typically, class-level annotation maps a specific request pattern Execute this method to process requests for /userlogin.htm. 7

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Components Acts as a Controller DispatcherServlet This class will return the Model And View Controller Class The class of the object that will be used to represent the user data. This is also called Form Backing Bean CommandClass Customizable view resolution class Application Context Configuration file ViewResolver Acts as View JSP* Note: *JSP is not part of Spring but it is commonly used to create a user interface in Spring applications 8

Copyright © 2012 Accenture All Rights Reserved. Spring MVC: See It Demonstration: Create a Spring MVC application. Time Allocated: 20 minutes Environment or File: SpringappController.java Steps: 1.Open Project Week2CodebaseM27_participant 2.Navigate to Java Resources/src 3.Open package com.accenture.adf.newcodington.module27.sample 4.Open SpringappController.java and complete the TODOs. 5.Open and review the index.html, web.xml, Module27-servlet.xml and hello.jsp files. 9

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Flow Client Browser Client request View Resolver DispatcherServlet Model and view SimpleUrlHandler Mapping WebApplication Context Configuration file The flow: Controller 10

Copyright © 2012 Accenture All Rights Reserved. Spring MVC DispatcherServlet (1 of 3) DispatcherServlet: Is the core of Spring MVC Acts as a Front Controller Coordinates all request handling activities Dispatches to registered handlers for processing a web request. 11

Copyright © 2012 Accenture All Rights Reserved. Spring MVC DispatcherServlet (2 of 3) Spring MVC’s front controller (DispatcherServlet) coordinates the entire request lifecycle: Configured in web.xml: Is mapped using a URL Pattern. In this case,.htm 12

Copyright © 2012 Accenture All Rights Reserved. Spring MVC DispatcherServlet (3 of 3) Spring MVC’s front controller (DispatcherServlet) coordinates the entire request lifecycle: All requests matching.htm pattern automatically will be mapped to DispatcherServlet DispatcherServlet loads Spring application context from an XML file* that usually contains definitions for the Spring MVC components Note: *default is -servlet.xml 13

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Application Flow (1 of 4) The application flow is: 1.DispatcherServlet receives request and coordinates business functionality 2.Looks for xml configuration file and calls appropriate controller 3. Controller maps the request to handler, handler processes request/returns instance of ModelAndView to DispatcherServlet 14

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Application Flow (2 of 4) 1.DispatcherServlet receives request and coordinates business functionality. 15

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Application Flow (3 of 4) Use the following in the.xml configuration file to send the DispatcherServlet looking for Controller(s). 2.DispatcherServlet looks for the xml configuration file and calls appropriate controller 16

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Application Flow (4 of 4) 3.Controller maps the request to appropriate handler which in turn processes the request and returns instance of ModelAndView to DispatcherServlet. 17

Copyright © 2012 Accenture All Rights Reserved. Spring MVC ModelAndView ModelAndView contains the model (some data) and either a logical view name, or an implementation of the View interface. 18

Copyright © 2012 Accenture All Rights Reserved. Spring MVC View Resolvers Logical view names become view objects. InternalResourceViewResolver resolves a logical view name… 19

Copyright © 2012 Accenture All Rights Reserved. Spring MVC Sample Code Follow the steps below to see examples on Spring Core: 1.Open Project - Week2CodebaseM27_participant 2.Run it on Tomcat server. This is dependent on completion of the previous See It. You should be able to see a click button. Click on it. Click on Home. You should see a screen like the one below (see 2a. below). 3.Click the link to view sample code. 4.Enter user name and password (see 4a. below). 5.Password should match the name. Try various combinations and see how it behaves. 2a. 4a. 20

Copyright © 2012 Accenture All Rights Reserved. Optional Activity 1: Spring MVC Objective: Write/modify a web-based application using Spring MVC Framework components to insert a record in the Museum table. Instructions: Navigate to the Module 27, Activity 1 page on the course web site. Follow the instructions provided on the web page to locate the codebase, launch Eclipse and complete the activity. 21

Copyright © 2012 Accenture All Rights Reserved. Questions and Comments 22

Copyright © 2012 Accenture All Rights Reserved. Module Summary MVC is a fundamental design pattern for separating user interface logic from business logic Spring Web MVC module is based on MVC design Pattern Spring MVC’s key components are: –DispatcherServlet –Controller Classes –View Resolvers 23