SSC - Web development Model-View-Controller for Java web application development

Similar documents
Tutorial: Building a Web Application with Struts

How To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post

Glassfish, JAVA EE, Servlets, JSP, EJB

Complete Java Web Development

Client-server 3-tier N-tier

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

CrownPeak Java Web Hosting. Version 0.20

Proposal for DSpace Web MVC

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat

A Comparative Study of Web Development Technologies Using Open Source and Proprietary Software

Building Web Applications, Servlets, JSP and JDBC

Web Container Components Servlet JSP Tag Libraries

Specialized Programme on Web Application Development using Open Source Tools

Customer Bank Account Management System Technical Specification Document

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

Commercial software development with the help of J2EE architecture and MVC

Framework Adoption for Java Enterprise Application Development

Web Pages. Static Web Pages SHTML

Java EE Web Development Course Program

Java Technology in the Design and Implementation of Web Applications

An introduction to creating JSF applications in Rational Application Developer Version 8.0

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Virtual Credit Card Processing System

SOFTWARE ARCHITECTURE FOR FIJI NATIONAL UNIVERSITY CAMPUS INFORMATION SYSTEMS

Technical White Paper The Excel Reporting Solution for Java

Enterprise Application Development In Java with AJAX and ORM

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

Apache Jakarta Tomcat

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012

Japan Communication India Skill Development Center

HPC PORTAL DEVELOPMENT PLATFORM

Japan Communication India Skill Development Center

Beginning POJOs. From Novice to Professional. Brian Sam-Bodden

JEE Web Applications Jeff Zhuk

Java Application Developer Certificate Program Competencies

Net-WMS FP Net-WMS SPECIFIC TARGETED RESEARCH OR INNOVATION PROJECT. Networked Businesses. D.8.1 Networked architecture J2EE compliant

Server-Side Web Development JSP. Today. Web Servers. Static HTML Directives. Actions Comments Tag Libraries Implicit Objects. Apache.

Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System

Course Name: Course in JSP Course Code: P5

Introduction to Web Applications using JSP, Servlets, Jstl and JQuery Workshop for ICOM5016

CS Developing Web Applications with Java Technologies

Portals, Portlets & Liferay Platform

In this chapter, we lay the foundation for all our further discussions. We start

MarkLogic Server. Reference Application Architecture Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Java (J2SE & J2EE) and Web Development Training Catalog

MVC pattern in java web programming

SSC - Web applications and development Introduction and Java Servlet (II)

JBoss Portlet Container. User Guide. Release 2.0

Building Web Services with Apache Axis2

Design Approaches of Web Application with Efficient Performance in JAVA

Roles in Building Web Applications using Java

Pentesting Web Frameworks (preview of next year's SEC642 update)

Unit 2 Research Project. Eddie S. Jackson. Kaplan University. IT530: Computer Networks. Dr. Thomas Watts, PhD, CISSP

Agenda. Summary of Previous Session. Application Servers G Session 3 - Main Theme Page-Based Application Servers (Part II)

A Monitored Student Testing Application Using Cloud Computing

Contents. Client-server and multi-tier architectures. The Java 2 Enterprise Edition (J2EE) platform

White Paper: 1) Architecture Objectives: The primary objective of this architecture is to meet the. 2) Architecture Explanation

JSP Java Server Pages

What Is the Java TM 2 Platform, Enterprise Edition?

Specialized Programme on Web Application Development using Open Source Tools

Developing XML Solutions with JavaServer Pages Technology

Get Success in Passing Your Certification Exam at first attempt!

Oracle Application Development Framework Overview

Services. Custom Tag Libraries. Today. Web Development. Role-Based. Development. Code Reuse. Tag Libraries Custom Tags. Tag Lifecycle.

Model-View-Controller. and. Struts 2

<Insert Picture Here> Betting Big on JavaServer Faces: Components, Tools, and Tricks

Japan Communication India Skill Development Center

Modern Software Development Tools on OpenVMS

AD-HOC QUERY BUILDER

Client/server is a network architecture that divides functions into client and server

2012 LABVANTAGE Solutions, Inc. All Rights Reserved.

A Modular Approach to Teaching Mobile APPS Development

Web and Enterprise Applications Developer Track

HPC Portal Development Platform with E-Business and HPC Portlets

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

DTS Web Developers Guide

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

JAVA Web Database Application Developer

Efficiency of Web Based SAX XML Distributed Processing

C/S Basic Concepts. The Gartner Model. Gartner Group Model. GM: distributed presentation. GM: distributed logic. GM: remote presentation

Web Applications. Originals of Slides and Source Code for Examples:

Building Java Servlets with Oracle JDeveloper

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology Fall 2007

Software Development Kit

<Insert Picture Here> Oracle Mobile Enterprise Application Platform Overview

Research Article. ISSN (Print) *Corresponding author Lili Wang

Japan Communication India Skill Development Center

EVALUATION OF SERVER-SIDE TECHNOLOGY FOR WEB DEPLOYMENT

Core Java+ J2EE+Struts+Hibernate+Spring

Web Applications and Struts 2

An Architecture for Web-based DSS

New Web Application Development Tool and Its MDA-Based Support Methodology

Stock Trader System. Architecture Description

Introduction to J2EE Web Technologies

Transcription:

SSC - Web development Model-View-Controller for Java web application development Shan He School for Computational Science University of Birmingham Module 06-19321: SSC

Outline Outline of Topics Java Server Pages (JSP) Model-View-Controller (MVC) Java Enterprise applications

Java Server Pages (JSP) What is Java Server Pages JSPs: a Java technology that provides a simplified, fast way to create easily maintain, information-rich, dynamic Web pages based on HTML, XML, or other document types. Viewed as a high-level abstraction of Java servlets: translated into servlets at runtime from the JSP source file Requires a Servlet container, e.g., Tomcat Life cycle of JSP: very similar to Java Servlet: Step 1: JSP Page Translation: Translated as Servlet source code Step 2: JSP Page Compilation: Compiled as Servlet class Other steps are similar to Java Servlet

Java Server Pages (JSP) What is Java Server Pages JSP Page (.jsp) Translate Servlet source (.java) Compile Servlet class (.class) _jspinit() Response _jspservice() Request _jspdestroy() Servlet container Finalisation and garbage collection

Java Server Pages (JSP) How to write JSP Java Code inside HTML using special JSP tags, called JSP Scriting elements Three categories of JSP Scriting elements: Declaration Tags: define varaibales and methods in JSP, start with <%! and end with %>, e.g., <%! String username = Shan; %> Expression Tags: produce output (a String object) that can be used to display result on JSP, start with <%= and end with %>, e.g., <%=name %> Scriptlets: start with <% and end with %>, e.g., <% java.util.date date = new java.util.date(); %>

Java Server Pages (JSP) JSP vs Java Servlet Differences: Java Servlet is HTML in Java, while JSP is Java in HTML. Servlets run faster compared to JSP since JSP needs to be translated and compiled before execution. More convenient to write JSP to generate HTML Q: When to use JSP? A: When there is not much data process and manipulation, otherwise use Model-View-Controller design pattern, where JSP used as View and Servlet as controller

Model-View-Controller (MVC) Java web application development: problems Many software systems are essentially to retrieve data from a data store, e.g., a database and display it for the user: The user changes the data using an user interface The system stores the updates in the data store Most straightforward design: combines user interface and data store to reduce the amount of coding and to improve application performance Problems: user interface tends to change much more frequently than the data storage system. mixed up the presentation (the user interface) and application logic (data store).

Model-View-Controller (MVC) What is Model-View-Controller (MVC)? MVC: a design pattern for efficiently relating the user interface to underlying data models. Three main components: Model: represents the underlying data structures in a software application and the functions to retrieve, insert, and update the data. Note: No information about the user interface. View: a collection of classes representing the elements in the user interface for the user to see on the screen Controller: classes connecting the model and the view, and is used to communicate between classes in the model and view.

Model-View-Controller (MVC) What is Model-View-Controller (MVC)? User Request Controller Return results Updates Manipulates View Model

Model-View-Controller (MVC) Advantages of MVC Better complexity management: Software separate presentation (view) from application logic (model) Consequently, code is cleaner and easier to understand Enable large teams of developers for parallel development Flexibility: Presentation or user interface can be completely revamped without touching the model Reusability: The same model can used for other application with different user interfaces

Model-View-Controller (MVC) MVC for Java Web Application Model: Plain Old Java Object (POJO) or Java Beans View: Java Server Pages (JSP) Controller: Java Sevlet, which decides: what application logic code to be applied in the model which JSP page is appropriate to present those particular results and forwards the request there A Java Sevlet Controller: handles incoming requests instantiates of model and invokes the correct application logic in the model for the request forwards the results from the model and request from the user to the appropriate view (JSP file) RequestDispatcher You can use request.setattribute or session.setattribute to pass the results to view

Model-View-Controller (MVC) MVC for Java Web Application User Request Controller (Servlet) Return results View (JSP pages) Forward Request/results Instantiate/ invoke Model (POJO/Bean)

Java Enterprise applications What is Enterprise applications? Enterprise applications: large-scale, multi-tiered, scalable, reliable, and secure network applications Three Tier architecture consists of: Presentation Tier: usually consists of clients and components that handle the interaction between clients and the application tier Application Tier (Business/Logic Tier): coordinates application, e.g., its business logic, decisions, calculations and evaluations, moves data between the presentation and data tiers. Data Tier (Enterprise Information Systems Tier): retrieves and stores data.

Data tier Application tier Presentation tier SSC - Communication and Networking Java Enterprise applications Enterprise applications 3-Tier architecture Java Enterprise Application Three Tier Architecture Browser with dynamic web pages Desktop applications Servlet/JSP/JSF componets EJB/POJO JDBC/Hibernate/JDO etc.

Java Enterprise applications Tools for Java Enterprise Application Development Java EE: the one your are learning but need learned more Spring Framework: one of the most popular open source application development framework for developing Java enterprise applications. Consists of many modules to simply development The key concept - Inversion of control: the control flow of a program is inverted, e.g., instead the programmer controls the flow of a program, the external source, e.g., Spring Framework takes control of it. The fundamental functionality - dependency injection: objects do not create other objects on which they rely to do their work. Instead, they get the objects from by a external framework component. The basic idea: to simplify development complexity by loosing couplings/dependencies between classes

Java Enterprise applications Links Java EE vs Spring Spring Tutorial - Eclipse Spring Tutorial - Netbean Spring guides