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



Similar documents
NetBeans IDE Field Guide

Glassfish, JAVA EE, Servlets, JSP, EJB

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

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

Building Web Applications, Servlets, JSP and JDBC

Installation Guide of the Change Management API Reference Implementation

A framework for web-based product data management using J2EE

Implementing the Shop with EJB

Introduction to Sun ONE Application Server 7

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

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

JAVA Web Database Application Developer

CrownPeak Java Web Hosting. Version 0.20

Crystal Reports for Eclipse

enterprise^ IBM WebSphere Application Server v7.0 Security "publishing Secure your WebSphere applications with Java EE and JAAS security standards

Application Notes for Packaging and Deploying Avaya Communications Process Manager Sample SDK Web Application on a JBoss Application Server Issue 1.

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga

How To Let A Lecturer Know If Someone Is At A Lecture Or If They Are At A Guesthouse

Portals, Portlets & Liferay Platform

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

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

Modern Software Development Tools on OpenVMS

SNMP and Web-based Load Cluster Management System

Applets, RMI, JDBC Exam Review

Java Web Programming with Eclipse

Mastering Tomcat Development

DeskNow. Ventia Pty. Ltd. Advanced setup. Version : 3.2 Date : 4 January 2007

JBS-102: Jboss Application Server Administration. Course Length: 4 days

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

Crawl Proxy Installation and Configuration Guide

CS Developing Web Applications with Java Technologies

Web Application Architecture (based J2EE 1.4 Tutorial)

DTS Web Developers Guide

Core Java+ J2EE+Struts+Hibernate+Spring

Server Setup and Configuration

QuickDNS 4.6 Installation Instructions

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

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

Chapter 3 Technology adapted

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

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

CONFIGURATION AND APPLICATIONS DEPLOYMENT IN WEBSPHERE 6.1

Communiqué 4. Standardized Global Content Management. Designed for World s Leading Enterprises. Industry Leading Products & Platform

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc.

Java Servlet and JSP Programming. Structure and Deployment China Jiliang University

@ - Internal # - Online TH PR OR TW TOTAL HOURS # @ 175

Testing and Deploying IBM Rational HATS 8.5 Applications on Apache Geronimo Server 3.1

Enterprise Application Development In Java with AJAX and ORM

A Performance Comparison of Web Development Technologies to Distribute Multimedia across an Intranet

Design Approaches of Web Application with Efficient Performance in JAVA

Oracle WebLogic Server 11g Administration

SAS Drug Development Integration & PheedIt

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

Architectural Overview

OXAGILE RESUMES SUMMARY OF QUALIFICATIONS TECHNICAL SKILLS SENIOR JAVA SOFTWARE ENGINEER

Japan Communication India Skill Development Center

Crystal Reports for Borland JBuilder

HP Education Services

What Is the Java TM 2 Platform, Enterprise Edition?

COM 440 Distributed Systems Project List Summary

Chapter 4. Architecture. Table of Contents. J2EE Technology Application Servers. Application Models

Migration Guide Software, Database and Version Migration

Lab Introduction to Web Services

BIRT Application and BIRT Report Deployment Functional Specification

PowerTier Web Development Tools 4

Web Development on the SOEN 6011 Server

Client-server 3-tier N-tier

Specialized Programme on Web Application Development using Open Source Tools

zen Platform technical white paper

Oracle WebLogic Server 11g: Administration Essentials

Java Server Pages and Java Beans

Online Fuzzy-C-Means clustering

Course Name: Course in JSP Course Code: P5

Creating Java EE Applications and Servlets with IntelliJ IDEA

The Comparison of J2EE and.net for e-business

Sports Management Information Systems. Camilo Rostoker November 22, 2002

IBM WebSphere Server Administration

Japan Communication India Skill Development Center

Web Container Components Servlet JSP Tag Libraries

JAVA/J2EE DEVELOPER RESUME

Integrating Online Banking and Top-up Card into Payment Gateway

WebSphere Product Family Overview

Developing XML Solutions with JavaServer Pages Technology

1. Introduction 1.1 Methodology

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

Web-based Automobile Sales Management System. Huabo Xiao

Japan Communication India Skill Development Center

Enterprise Application Integration

Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat

Link Analysis Tool Design Description Final Version

Web Applications and Struts 2

WebSphere Server Administration Course

Transcription:

CSI 2132 Lab 8 Web Programming JSP 1 Outline Web Applications Model View Controller Architectures for Web Applications Creation of a JSP application using JEE as JDK, Apache Tomcat as Server and Netbeans as IDE View Layer: JSP pages Definition of the Servlet Logical / Controller Layer: Java code Database Layer: Enterprise Java Beans 2 1

Web Applications To add logic (program code) inside a web server, Sun Microsystems extended the Java language with the introduction of the API Java Servlets. Client Web Server Database Server 3 Model View Controller Web applications are usually build following the three layers model. According to this model three separate and perfectly defined process or modules are executed in different platforms Interaction Control Construction Of the Web Page Business Logic 4 2

Model View Controller An architecture that separates the application components: Model: Represents the data View: User Interface Controller: Handles the user input and the application flow. It is implemented as a Java Servlet. Input Page (view) Output Page (view) Servlets (controllers) Show Pages (JSP) Enterprise Java Beans (model) 5 Architectures for Web Applications Model View Controller 6 3

Architectures for Web Applications Model Encapsulates the business domain. It is completely independent from the Controller and the View. View: Presentation of the model, it can access to the model, but never change it state. It can be notified when there is a change in the model state. Controller: Responds to the client request, executing the appropriate action and creating the pertinent model. 7 Web Project in Netbeans File New Project Java Web Web Application Give it a name Select proper Server settings Don t select any Framework 8 4

Download web project to work on From the course website, download the file: JSP1.zip Decompress it and copy it within Netbeans directory Copy the immediate JSP folder that contains files. Open this project from Netbeans File Open Project Select JSP1 Project 9 JSP Application So far: Take a look at each jsp file 10 5

JSP Application (Controller) Create the controller that manages user requests 11 JSP Application (Controller) Create a new Java package (control) Create a new Java Class under this package (Control.java) Basic methods in Control.java Modify Index.jsp to call the servlet <form action="control" method="post"> 12 6

JSP Application (Controller) Modify the web.xml file to use control as servlet WEB-INF Web.xml Servlets tab Add Servlet Element Test the application so far 13 JSP Application (DB Connection) 14 7

JSP Application (DB Connection) Take a look at java classes under connection package Password Set your own password DataAccess Comment / Uncomment the apropiate connection line (using lab computers or Laptops) Notice that PostgreSQL JDBC driver is already imported under Libraries folder 15 JSP Application (DB Connection) Instantiate the DB object from the Servlet Create connection Open connection Close Connection 16 8

JSP Application (EJBs) 17 JSP Application (Create EJBs) CustomerBean Import DataAccess java.sql Attributes Connection Statement ResultSet Customer Name Customer id 18 9

JSP Application (Create EJBs) CustomerBean Methods setname getname setcustid getcustid existscustomer Receives» name to look for» DB object db Returns» Customer id or -1 if not found insertcustomer Receives» name to look for» DB object db Returns» Customer id 19 JSP Application (Create EJBs) LikeArtistBean Import DataAccess java.sql Attributes Connection Statement DataAccess ResultSet LikeArtistList 20 10

JSP Application (Create EJBs) LikeArtistBean Methods setdataaccess existslikeartist Receives» Customer id» Artist name» DB object db Returns» True if it this record already exists, false otherwise insertlikeartist Receives» Customer id» Artist name» DB object db getlikeartistlist Returns» All info in LikeArtist table in HTML table format 21 JSP Application (Implement Logic) 22 11

JSP Application (Implement Logic) Within the Servlet (Control.java) Check the customer exists Insert the Customer if it doesn t exist Check relation Customer Artist already exists Insert relation if it doesn t exist 23 JSP Application (Implement Session) 24 12

JSP Application (Implement Session) Create Session within our Servlet (Control.java) Save EJBs with information within Session Check Session is valid in menu.jsp Close Session in closesession.jsp 25 JSP Application (Show LikeArtist tbl) 26 13

JSP Application (Show LikeArtist tbl) Retrieve information from Session and show LikeArtist table 27 JSP Application 28 14

CSI 2132 Lab 8 Web Programming JSP 29 15