OOSSE Week 7 Java Server Pages Format of lecture: Introduction What are Java Server Pages? (JSPs) What do you need to run JSPs? Demo of an example of a.

Slides:



Advertisements
Similar presentations
Lecture plan Information retrieval (from week 11)
Advertisements

DT228/3 Web Development WWW and Client server model.
Time Scalability Single User Unlimited Users 100s of Users Several Users PC based Single user Late 1980sNow PC based, file-level locking Single user or.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
J4www/jea Week 3 Version Slide edits: nas1 Format of lecture: Assignment context: CRUD - “update details” JSP models.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
BICS546 Client/Server Database Application Development.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Time Scalability Single User Unlimited Users 100s of Users Several Users PC based Single user Late 1980sNow PC based, file-level locking Single user or.
DT211/3 Internet Development Application Internet Development Application.
Introduction to Web Interface Technology (CSE2030)
Introduction to Web Based Application. Web-based application TCP/IP (HTTP) protocol Using WWW technology & software Distributed environment.
Copyright © 2002 Pearson Education, Inc. Slide 4-1 Choosing the Hardware for an E-commerce Site  Hardware platform  Refers to all the underlying computing.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Introduction to Servlet & JSP
Enterprise/Server-side Java Slide edited by NAS Introduction Welcome! As usual the module lasts for 12 weeks with the last.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Java Servlets. What Are Servlets? Basically, a java program that runs on the server Basically, a java program that runs on the server Creates dynamic.
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Web-based Software Development - An introduction.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Introduction to Internet Programming (Web Based Application)
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
Java for networking Module Introduction Data Communications Communication architecture Application.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
WEB SERVER SOFTWARE FEATURE SETS
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
1 LM 6 Database Applications Dr. Lei Li. Learning Objectives Explain three components of a client-server system Describe differences between a 2-tiered.
1 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Studio.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Web Programming Language
WWW and HTTP King Fahd University of Petroleum & Minerals
Lecture 1: Multi-tier Architecture Overview
Presentation transcript:

OOSSE Week 7 Java Server Pages Format of lecture: Introduction What are Java Server Pages? (JSPs) What do you need to run JSPs? Demo of an example of a JSP in action Version 1.2 Nov 2009 Slide 1

OOSSE Week 7 Web-Enabled Applications Objectives of this session:- Overview/History. List the advantages of web-enabled applications. Understand how object oriented technology can help with this type of application. List technologies that make web-enabled applications possible. List the capabilities of tools in developing this type of application. Version 1.1 Nov 2008 Slide 2

OOSSE Week 7 Overview Early web users were limited to static HTML. Useful for presenting company information often in a hierarchical manner. Little or no interaction with the user. Java applets addressed this problem enabling additional code to be downloaded but still a problem of building customised information. Dynamically generated HTML using the Common Gateway Interface (CGI) was also a proposed solution. Version 1.1 Nov 2008 Slide 3

OOSSE Week 7 Overview CGI-created HTML was the forerunner for server-side Java based techniques. Java Servlets. JavaServer Pages(JSP). Component-based computing (Enterprise JavaBeans). Active Server Pages (ASP). Hypertext Preprocessor (PHP) Visual Basic Web Classes. Version 1.1 Nov 2008 Slide 4

OOSSE Week 7 Evolution of Applications – good exam question! One-tier - mainframe based/dumb terminal/central application source. Standalone/PC/Mini computers/multi copy of application. Two tier - client-server - distributed part of the application on the client(GUI) and part on the server. Version 1.1 Nov 2008 Slide 5

OOSSE Week 7 Evolution of Applications – good exam question! Two tier - client-server Early versions of client-server required installation of GUI and business logic. Recently, Java applets downloaded on demand. With server side servlets and JSP no download and the browser is used as the interface - this is a good solution! Version 1.1 Nov 2008 Slide 6

OOSSE Week 7 Evolution of Applications Three tier/n-tier - user interface(UI) layer; the business layer(BL) and the database layer(DL) UI - presentation of information browsers such as Netscape or Explorer on the client BL - logic of procedures about the business DL - where the data is stored - usually a relational database but could be an object oriented database Version 1.1 Nov 2008 Slide 7

OOSSE Week 7 Benefits of Web-Enabled n-tier Applications Web applications can be called self-service applications - they enable ‘things’ to be done from a web browser - e.g. online banking. Run from anywhere - installation free. Cost reduction: Browser based interface is easy to use - little training required. Development costs lower as using a standard interface. No installation. Use of open standards: Maintenance easier. Enhancement of applications easier. Version 1.1 Nov 2008 Slide 8

OOSSE Week 7 Web Enabling Techniques How to develop web-based applications and how can a server process multiple requests? Need a fast response! Scalability - HTTP protocol - works in a stateless request-response mode - means it does not bind a server to a client for an inordinate amount of time There are a number of techniques which can be used to concurrently deal with thousands of clients Version 1.1 Nov 2008 Slide 9

OOSSE Week 7 Stuff that we need Just like when using ASP or PHP, we need a server that “understands” our JSP code We need an http server which supports JSP We will use a (free) commercial server called Tomcat We could use Glassfish, in part based on Tomcat ( ) Version 1.1 Nov 2008 Slide 10

OOSSE Week 7 What are JSPs? They are HTML documents that are interleaved with Java which provides the dynamic content. JSPs are server-side - they accept a request and generate a response (an HTML document). JSP is the next generation on from Servlets - an extension of Servlets with more power and flexibility. JSPs are the equivalent of Microsoft’s Active Server Pages (ASP) technology and Zend’s PHP system. Version 1.1 Nov 2008 Slide 11

OOSSE Week 7 Facts about JSPs All JSPs have a file extension of.jsp JSP is meant to be easier than Servlets. A JSP page generates a Servlet (or more) Syntax of a typical JSP is on the next two slides. Over the next four weeks we will look at the syntax of JSPs in depth. Version 1.1 Nov 2008 Slide 12

OOSSE Week 7 simpleguestlist.jsp An Example of a Simple JSP Accessing a database Model A Listing Of Guests Firstname Lastname Version 1.1 Nov 2008 Slide 13

OOSSE Week 7 <% try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:odbc:GuestBook"); Statement statement = conn.createStatement(); String sql = "SELECT * FROM GuestBook"; ResultSet rs = statement.executeQuery(sql); while (rs.next()) { %> <% } %> <%if (statement != null) statement.close(); if (conn != null) conn.close(); } catch (Exception e) {out.print(e);} %> Version 1.1 Nov 2008 Slide 14

OOSSE Week 7 Kit required What do you need to develop and run JSPs? Up-to-date JDK Tomcat HTTP server With database interaction we need a database – we will use MSAccess for convenience We could use mySQL or any other supported SQL-based database Version 1.1 Nov 2008 Slide 15

OOSSE Week 7 Demo of a JSP This example is a JSP which uses a DSN to the GuestBook database Normally we prefer DSN-less connections The application model is essentially a JSP connecting to a database Version 1.1 Nov 2008 Slide 16

OOSSE Week 7 JSP Translation process Version 1.1 Nov 2008 Slide 17 file (HTML interleaved with Java) HTTP Server TOMCAT Request:Browser page link to call.jsp (either via locator or a link on an HTML input page) Response: HTML for output sent from Server Response HTML document Request: JSP translated into a Servlet.java file and then compiled into a Servlet,class Backend database, usually on the server Query for data content

OOSSE Week 7 SimpleGuestList.jsp Version 1.1 Nov 2008 Slide 18

OOSSE Week 7 Summary We have established that JSP represents a technology that can be used for dynamic web applications The market for this type of technology is well established JSP demands some programming skills but is more and more seen as an integration technology with can dovetail with technologies such as XML Version 1.1 Nov 2008 Slide 19

OOSSE Week 7 Summary We used an HTTP server which supports JSP We highlighted the features of a JSP A.jsp file is essentially HTML with Java code inserts When the.jsp file is called via a browser a.java file is created to represent Servlet source code and then the.java file is compiled into a bytecode file with a.class extension. The.java file can be viewed via a text editor but MUST not be edited The compilation is only done once - subsequent calls to the JSP use the already compiled.class file Version 1.1 Nov 2008 Slide 20

OOSSE Week 7 Mal’s E-Commerce This is one of my sample E-Commerce sites that uses Mal’s E-Commerce shopping cart software From the source code of the site you can see how it it configured to use Mal’s system To use the software you must apply for an account and then it is a question of following the instructions given via the Mal’s websitewebsite Version 1.1 Nov 2008 Slide 21