CSC 2720 Building Web Applications Frameworks for Building Web Applications.

Slides:



Advertisements
Similar presentations
Web Development with Karsten Schulz Terp-Nielsen Master Principal Sales Consultant Oracle Denmark.
Advertisements

Apache Struts Technology
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)
Struts1 Apache Struts Dr Jim Briggs. Struts2 What is Struts? Struts is an open source framework for building Java web applications Supports MVC/Model.
J2EE Servlets and JSP Advanced topics Presented by Bartosz Sakowicz.
MVC Architecture1 Usage Rules PowerPoint slides for use only in for-credit courses at degree-granting institutions Slides can be modified.
Integrating Servlets and JavaServer Pages Vijayan Sugumaran School of Business Administration Oakland University Parts of this presentation provided by.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Apache Struts Technology A MVC Framework for Java Web Applications.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Struts 2.0 an Overview ( )
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.
MVC pattern and implementation in java
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Introduction to JSP Based on: Marty Hall, Larry Brown, Core Servlets and JavaServer Pages.
What Are Beans? beans are simply Java classes that are written in a standard format. A bean class must have a zero-argument (default) constructor. A bean.
JavaServer Faces Jeff Schmitt October 5, Introduction to JSF Presents a standard framework for building presentation tiers for web applications.
Li Tak Sing COMPS311F. Static attributes in Servlets Since Servlets are also Java classes, you can also use static attributes to store values that can.
JSP Architecture Outline  Model 1 Architecture  Model 2 Architecture.
Chapter 8 Script-free pages. Problem with scripting in JSP When you use scripting (declaration, scriplet, expressions) in your JSP, you actually put Java.
Web applications using JavaServer Faces (JSF) A brief introduction 1JavaServer Faces (JSF)
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
CGS – 4854 Summer 2012 Web Site Construction and Management Instructor: Francisco R. Ortega Chapter 2.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
CGS – 4854 Summer 2012 Web Site Construction and Management Instructor: Francisco R. Ortega Chapter 3 Part 1.
Case Study + MVC Lec Error Pages By means of the page directive, a JSP can be given the responsibility of an Error page An Error JSP will be called.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
MVC Model 2 Architecture & AddressBook case study
CSC 2720 Building Web Applications JavaServer Pages (JSP) The Basics.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
Model View Controller MVC Web Software Architecture.
Fall 2007cs4201 Advanced Java Programming Umar Kalim Dept. of Communication Systems Engineering
 Obtaining a RequestDispatcher Forwarding requests from servlets to dynamic resources  Forwarding requests from servlets to static resources  Using.
CSC 2720 Building Web Applications JavaServer Pages (JSP) JSP Directives and Action Elements.
Fall 2007cs4201 Advanced Java Programming Umar Kalim Dept. of Communication Systems Engineering
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
J2EE T ECHNOLOGIES These are the technologies required to build large scale distributed applications, can be divided into – Component Technologies eg.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Vakgroep Informatietechnologie – Onderzoeksgroep (naam) Web Centric Design of Distributed Software.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
JavaServer Faces framework Craig McClanahan is presented that created Struts web framework and based on experience gathered designed JavaServer.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
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.
DA-YEH University CSIE Pattern-Oriented Design The Dynamic Mapping Design Pattern Author : J. Gresh J. McKim J. McKim H. Sanchez H. Sanchez Excerpt From.
USING JAVABEANS COMPONENT IN JSP DOCUMENTS. References Marty Hall. Core Servlet and Java Server Page. Sun Micro System. Prentice Hall PTR; 1 edition 2000.
Introduction To HTML Dr. Magdi AMER. HTML elements.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
JSP / Servet (2) Bayu Priyambadha, S.Kom. MVC (Model View Controller)  Model (data logic)  Java Class (standard class, servlet, JavaBeans, or other.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Enterprise Java v050228MVC1 Model, View, Controller Web Architecture.
MODEL VIEW CONTROLLER PATTERN. Model View Controller MVC is a time tested method of separating the user interface of an application from its Domain Logic.
Pre assessment Questions
Engineering the Java Web Application (MVC)
Model-View-Controller Patterns and Frameworks
The Model Layer What is Model?
Struts BY: Tejashri Udavant..
Presentation transcript:

CSC 2720 Building Web Applications Frameworks for Building Web Applications

Model-1 Architecture  A web application is made up of many JSP pages  Each JSP page is regarded as the focal point for the entire application.  Each JSP page  Contains code for extracting HTTP request parameters, call the business logic (implemented in JavaBeans, if not directly in the JSP)  Contains the presentation logics  Suitable for small/simple application

Model-2 Architecture  Also called Model-View-Controller (MVC) architecture  Model: The data  View: Representation of the model  Controller: Processes and responds to events (typically user actions) and update the model accordingly  MVC aims at separating data (model) from user interface (view) so that changes to the user interface will not affect data handling, and that the data can be reorganized without changing the user interface.

Model-2 Architecture in Web Application  One servlet serves as controller (Can be more than one servlet serving as controllers)  The controller handles requests, decides what logic to invoke, and decides what JSP page to apply.  Results are placed in beans (or to objects that can be accessed by the JSP pages.)  Request is forwarded to a JSP page to format result  Different JSP pages can be used to handle different types of presentation  Suitable for large or complicated application

MVC Flow of Control Source:

Implementing MVC with RequestDispatcher 1.Define beans to represent the data 2.Use a servlet to handle requests  Servlet reads request parameters, checks for missing and malformed data, etc. 3.Populate the beans  The servlet invokes business logic (application-specific code) or data-access code to obtain the results. Results are placed in the beans that were defined in step 1.

Implementing MVC with RequestDispatcher 4.Store the bean in the request, session, or servlet context  The servlet calls setAttribute on the request, session, or servlet context objects to store a reference to the beans that represent the results of the request. 5.Forward the request to a JSP page  The servlet determines which JSP page is appropriate to the situation and uses the forward method of RequestDispatcher to transfer control to that page.

Implementing MVC with RequestDispatcher 6.Extract the data from the beans.  The JSP page accesses beans with jsp:useBean and a scope matching the location of step 4. The page then uses jsp:getProperty to output the bean properties.  The JSP page does not create or modify the bean; it merely extracts and displays data that the servlet created.

Example of a Controller … public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String operation = request.getParameter("operation"); if (operation == null) operation = "unknown"; String address; if (operation.equals("order")) address = "/Order.jsp"; else if (operation.equals("cancel")) address = "/Cancel.jsp"; else address = "/UnknownOperation.jsp"; RequestDispatcher dispatcher = request.getRequestDispatcher(address); dispatcher.forward(request, response); }

Web Application Framework  A web application framework is a software framework that is designed to support the development of dynamic websites and Web applications.web application framework  Aims  Improve productivity  Promote code reuse  Minimize errors  Reduce cost of maintenance  Typically based on an MVC architecture and include additional libraries.  e.g.: JavaServer Faces (JSF), Struts

References  Wikipedia 