Chapter 2 An Overview of Servlet and JSP Technology.

Slides:



Advertisements
Similar presentations
Lecture plan Information retrieval (from week 11)
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.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
J4www/jea Week 3 Version Slide edits: nas1 Format of lecture: Assignment context: CRUD - “update details” JSP models.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
J2EE Java2 Enterprise Edition by Damian Borth. Contents Introduction Architectures styles Components Scenarios Roles Processing a HTTP request.
Multiple Tiers in Action
Apache Tomcat Server Typical html Request/Response cycle
Java Server Pages B.Ramamurthy. Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Comp2513 Java Server Pages Daniel L. Silver, Ph.D.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Web programming for project students Dr Jim Briggs.
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems JavaServer Pages (JSP)
TimeTracker 2, Take 1  Servlets Web Interface (jsp) Servlet (business logic and processing) App Engine Datastore Form Submit R/W.
CS 160: Software Engineering August 27 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Chapter 1 Web Server Setup and Configuration. Contents A.What is web server B.Installing and Configuring Web Server C.Testing the Installation.
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.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
INTRODUCTION TO WEB DATABASE PROGRAMMING
J2EE Web Fundamentals Lesson 1 Introduction and Overview
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Netbeans – jsp.zip Introduction to JSP Netbeans – jsp.zip.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
JSP Architecture Outline  Model 1 Architecture  Model 2 Architecture.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Chapter 10 Overview of JSP Technology. Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content.
Case Study + MVC Lec 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.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Introduction to JavaServer Pages. 2 JSP and Servlet Limitations of servlet  It’s inaccessible to non-programmers JSP is a complement to servlet  focuses.
Java Portals and Portlets Submitted By: Rashi Chopra CIS 764 Fall 2007 Rashi Chopra.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Struts 2 introduction. Struts 2 framework Struts 2 A full-featured web application framework for the Java EE platform The Java Servlet API exposes the.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Chapter 1 Server Setup and Configuration. Contents A.Installing and Configuring Web Server B.Testing the Installation.
JSP Server Integrated with Oracle8i Project2, CMSC691X Summer02 Ching-li Peng Ying Zhang.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
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.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
JSP / Servlets and Beans
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
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.
Java Servlets.
By Dr. Kodge Bheemashankar G
MSIS 655 Advanced Business Applications Programming
Objectives In this lesson you will learn about: Need for servlets
J2EE Lecture 1:Servlet and JSP
Struts BY: Tejashri Udavant..
Presentation transcript:

Chapter 2 An Overview of Servlet and JSP Technology

Contents 1.Building Web Pages Dynamically 2.Understanding the Role of Servlets 3.Understanding the Role of JSPs 4.Servlet Jobs 5.Comparing Servlet and JSP

1. Building Web Pages Dynamically The Web page is based on data sent by the client The Web page is derived from data that changes frequently

2. Understanding the Role of Servlets 2.1. Servlets 2.2. Problem: Displaying Even Numbers

2.1. Servlets Java programs that run on Web or application servers The role of web middleware Acting as a middle layer between requests coming from Web browsers or other HTTP clients and databases or applications on the HTTP server

2.2. Problem: Displaying Even Numbers Develop a servlet that shows all even numbers from 1 to 100 as shown below:

Solution Project name: EvenNumbers Package name: evennumbers Developing the Servlet Class Deploying the Servlet to the Web Server

Developing the Servlet Class

Deploying the Servlet to the Web Server Save EvenNumbersServlet.class to TOMCAT_DIR/webapps/ROOT/WEB- INF/classes/evennumbers/ Declaring EvenNumbersServlet in web.xml

3. Understanding the Role of JSPs 3.1. JSPs 3.2. Problem: Displaying Even Numbers

3.1. The role of JSP HTML pages with Java code embedded inside  Simplifying the creation and maintenance of the HTML

3.2. Problem: Displaying Even Numbers Develop a JSP that shows all even numbers from 1 to 100 as shown below:

Solution Save EvenNumbers.jsp to TOMCAT_DIR/webapps/ROOT

4. Servlet Jobs Read the explicit data sent by the client. Read the implicit HTTP request data sent by the browser. Generate the results. Send the explicit data (i.e., the document) to the client. Send the implicit HTTP response data.

5. Comparing Servlet and JSP ServletJSP Java programs with HTML embedded inside of them HTML pages with Java code embedded inside of them Mostly like a regular Java class Mostly like a normal HTML page The servlets get compiled JSP pages get translated into servlets Run at request time

Using Servlet and JSP technology JSP is focused on simplifying the creation and maintenance of the HTML Servlets are best at invoking the business logic and performing complicated operations Servlets are best for tasks oriented toward processing, whereas JSP is best for tasks oriented toward presentation For still others, neither servlets alone nor JSP alone is best, and a combination of the two (see Chapter 15, "Integrating Servlets and JSP: The Model View Controller (MVC) Architecture") is best.Chapter 15

References 1.Core Servlets And Java Server Pages, Volume 1, 2 nd Edition, Chapter 2

Practice Exercises 1. Create a JSP page that shows all of characters from ‘A’ to ‘Z’ 2. Create a JSP page that show all prime numbers from 1 to Create a Servlet page that show all perfect numbers from 1 to (a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself. For example: 6 = , 28 = ) positive integerdivisors