Web programming for project students Dr Jim Briggs.

Slides:



Advertisements
Similar presentations
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
Advertisements

JSP and web applications
Java Server Pages (JSP)
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
An introduction to Java Servlet Programming
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
DT211/3 Internet Application Development
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
Web architecture Dr Jim Briggs Web architecture.
DT228/3 Web Development JSP: Directives and Scripting elements.
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Session-01. What is a Servlet? Servlet can be described in many ways, depending on the context: 1.Servlet is a technology i.e. used to create web application.
Chapter 4 Servlets Concept of Servlets (What, Why, and How) Servlet API Third-party tools to run servlets Examples of Using Servlets HTML tag with GET.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Java Servlets and JSP.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Chapter 10 Servlets and Java Server Pages. A servlet is a Java class designed to be run in the context of a special servlet container An instance of the.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
Introduction Servlets and JSP Celsina Bignoli
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 9 JavaServer Pages (JSP) (Based on Møller.
Web technologies and programming cse hypermedia and multimedia technology Fanis Tsandilas April 3, 2007.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Web Application Programming Carol Wolf Computer Science.
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Functionality of a web server What does the web server do? Let a user request a resource Find the resource Return something to the user The resource can.
Introduction to Java Server Pages (JSPs) Robert Thornton.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Stanisław Osiński, 2002JSP – A technology for serving dynamic web content Java Server Pages™ A technology for serving dynamic web content Stanisław Osiński,
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
CSC 2720 Building Web Applications JavaServer Pages (JSP) The Basics.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Advanced Java Session 6 New York University School of Continuing and Professional Studies.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
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.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
JAVA, JEE Training Introduction to Web Harinath Mallepally
WEB1P webarch1 Web architecture Dr Jim Briggs. WEB1P webarch2 What is the web? Distributed system Client-server system Characteristics of clients and.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
Building Web Apps with Servlets
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
Knowledge Byte In this section, you will learn about:
Web App vs Mobile App.
JavaServer Faces: The Fundamentals
J2EE Lecture 1:Servlet and JSP
Presentation transcript:

Web programming for project students Dr Jim Briggs

What is the web? Distributed system Client-server system Characteristics of clients and servers –Servers always on / Clients choose when on –Clients do not need high performance if the work is done on the server Protocol based

Basic architecture of the web

Common web tools Browsers –Microsoft Internet Explorer –Netscape Navigator –Mozilla (Firefox) –Opera –Safari –Konqueror –Lynx Servers –Apache –Internet Information Server (Microsoft) –Sun –Netscape –Omni –Roxen –NCSA

HTTP protocol Specified by – Based on requests and responses A response can contain any document –MIME ( Multipurpose Internet Mail Extensions ) types – A stateless protocol Normally transported via a TCP/IP connection –Default port is TCP 80

HTTP requests Requests –GET –POST –PUT –HEAD Example request GET HTTP/1.1

HTTP responses HTTP/ OK Server: Microsoft-IIS/4.0 Date: Mon, 29 Apr :50:53 GMT Content-Type: text/html Accept-Ranges: bytes Last-Modified: Wed, 10 Apr :12:34 GMT ETag: "085fb85aae0c11:54fb" Content-Length: University of Portsmouth - Our University...

An error response HTTP/ Object Not Found Server: Microsoft-IIS/4.0 Date: Mon, 29 Apr :58:12 GMT Content-Length: Content-Type: text/html University of Portsmouth - Our University...

Dynamic web pages Four models: –Server-side includes –CGI –Server modules –Auxiliary servers

CGI architecture

CGI specification Specified at

Server module

Auxiliary server

Common web languages Java/JSP ASP (.NET) / C# PHP Perl Ruby on Rails

Architecture of a Java web application

Introduction to Java web apps Servlets and JSPs Servlet container –Tomcat A container may run several (independent) web applications (webapps) Each must have a WEB-INF directory: –web.xml configuration file –classes directory –lib directory

Important classes and interfaces 1 All servlets must implement the Servlet interface Class HttpServlet –init/destroy –doGet/doPut –Your servlet will derive from this

Important classes and interfaces 2 2 parameters to a request handling method Class HttpServletRequest –String param = request.getParameter(name); Class HttpServletResponse –PrintWriter out = response.getWriter(); Class HttpSession –Holds data common to related requests

JavaServer Pages (JSP) Distinction: –servlets: HTML embedded in program –JSP: program embedded in HTML Useful where majority of effort is page design Translated automatically into a servlet –Retranslated if changed (no need to restart server) Can be placed anywhere in a web application –but not visible to client if in the WEB-INF directory

JSP elements Scriptlets Actions Directives Standard tags Custom tags Expression language

Scriptlets Any Java code between Expressions – Declarations – DEPRECATED –Do not use - not XML –Much easier to use JSTL

JSP actions Including other files – –Request time inclusion Accessing beans –

JSP directives Page directive – Include directive – –Translation time inclusion

Java Standard Tag Library (JSTL) Taglib directive – Core – SQL XML Format

Custom tags Implement your own tags Create a Tag Library Definition (tld) file Extend predefined classes Specify your library in directive Use like JSTL tags

Expression language Refer to Java Beans and other common classes ${expression} can appear as tag attributes or (since JSP 2.0) in the page itself Several implicit objects: –header ${header["user-agent"]} –param ${param['name']} ${param.name}

Java tools NetBeans –IDE –edit, compile, build, run, debug –lots of wizards –support for Struts –support for Hibernate (through nbxdoclet) Eclipse

Web application system architecture

Model View Controller (MVC)

MVC in Java

Relationship between Struts and Hibernate

Struts information flow

Role of the persistence layer