Case Study + MVC Lec - 39. 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.

Slides:



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

Java Server Pages Jeffrey Jongko. Introduction Java Server Pages (JSP) technology was created by Sun Microsystems and is built on top of Sun’s Java Servlet.
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)
Model-View-Controller ("MVC") This is a architectural design pattern for interactive applications. This design pattern organizes an interactive application.
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
Layers & Tiers Umair Javed Lec - 41.
GridScape Ding Choon Hoong Grid Computing and Distributed Systems (GRIDS) Lab. The University of Melbourne Melbourne, Australia WW Grid.
Java Server Faces Model/View/Controller Design Pattern for Web Development Slides adapted from “Core JavaServer Faces” by Geary and Horstmann and the J2EE.
Structure of a web application1 Dr Jim Briggs. MVC Structure of a web application2.
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.
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.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 37 - JavaServer Pages (JSP): Bonus for Java Developers Outline 37.1 Introduction 37.2 JavaServer.
AddressBook using Servlets and Intro to JSP Lec - 33.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
11. Java-Based Web: JSP, JSF. 2 Motto: Rule 1: Our client is always right Rule 2: If you think our client is wrong, see Rule 1. - Anonymous.
Netbeans – jsp.zip Introduction to JSP Netbeans – jsp.zip.
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
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)
J2EE Structure & Definitions Catie Welsh CSE 432
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Fall CIS 764 Database Systems Design L8. Web ….
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Chapter 2 An Overview of Servlet and JSP Technology.
MVC Model 2 Architecture & AddressBook case study
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.
CSC 2720 Building Web Applications Frameworks for Building Web Applications.
JavaServer Faces (JSF) and Ajax Integration. Agenda 대강의 ( 정말로..) 개요 예제 아키텍트라면..
Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Model View Controller MVC Web Software Architecture.
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
© 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.
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.
Implementation Struts Framework for well-architectured web applications Model-View-Controller design pattern.
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.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
JSP / Servlets and Beans
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.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Online Airline Reservation System
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
Structure of a web application
Design and Maintenance of Web Applications in J2EE
Introduction to Struts
Model-View-Controller (MVC) Pattern
JavaServer Faces: The Fundamentals
Enterprise Java Beans.
Struts BY: Tejashri Udavant..
Presentation transcript:

Case Study + MVC Lec - 39

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 by the Web Server when an uncaught exception gets generated The exception is passed as an instance of java.lang.Throwable to the Error JSP (accessible via implicit exception object)

Defining & Using Error Pages isErrorPage attribute of page directive is used to declare a JSP as an error page. JSP pages are informed about the error page by setting errorPage attribute of page directive.

Example Case Study Address Book using Model-1 architecture

Address Book ingredients Database

Address Book ingredients JavaBeans –PersonInfo Has attributes –name –address –phoneNum –PersonDAO Encapsulate Database logic Used to retrieve & save PersonInfo data

Address Book ingredients JavaServer Pages –addperson.jsp Used to collect new person info –saveperson.jsp Receives person info from addperson.jsp Saves it into database –searchperson.jsp Used to provide search criteria to search Person’s info, based on name –showperson.jsp Receives person name, to be searched in database Retrieves & display person records against that person name

Address Book ingredients JavaServer Pages (cont.) –Error Pages addbookerror.jsp –Identifies the type of exception –Displays the message associated with the received exception

Program Flow addperson.jsp saveperson.jsp showperson.jsp PersonInfo PersonDAO JavaBeans uses addbookerror.jsp exception searchperson.jsp

Lets put it all together Netbeans project addressbookusingmodel1

Model View Controller Design Pattern

Model-View-Controller Design Pattern MVC separates –Application data (contained in the model) from –Graphical presentation components (the view) & –Input/Event processing logic (the controller)

MVC in general modelview controller

MVC in general: model modelview controller Represents the state of the component (ie its data and the methods required to manipulate it) Independent of how the component is viewed or rendered

MVC in general: view modelview controller Appearance of the component Can be multiple views for the same model within a single applications Model may have different views in different applications or operating systems

MVC in general: controller modelview controller Dictates how a component interacts with events Sends events of interest to the model so that it can update itself

MVC in summary

Evolution of MVC Architecture No MVC 2.MVC Model 1 3.MVC Model 2 4.Web application framework (based on MVC model2) –Struts, Sun ONE application framework 5.Web application framework –JavaServer Faces (JSF)

MVC Model 1 Architecture

MVC Model 1

MVC Model 1 – A Detailed Story Client JSP Engine & Web Server JSP Engine & Web Server request JSP File JSP File request Call for component Component (JavaBean or EJB) Component (JavaBean or EJB) response Data response Compiled Servlet

MVC Model 2 Bean JSP JSP / Servlet Controller View Model