DT228/3 Web Development Introduction to Java Server Pages (JSP)

Slides:



Advertisements
Similar presentations
Question examples. Session 1 Objectives Why certify? Positioning of the non-technical version What is Java? Key advantages of Java Java Applications vs.
Advertisements

JSP and web applications
Java Server Pages (JSP)
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
An architecture for webb applications, J2EE
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
DT211/3 Internet Application Development JSP: Processing User input.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
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
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
DT228/3 Web Development JSP: Directives and Scripting elements.
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.
DT228/3 Web Development Active Server Pages & IIS Web server.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
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.
CS 160: Software Engineering August 27 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
Intro to Servlets Lec 26. Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
Java Pet Store Application. Outline Introduction Introduction Information Layer Information Layer Application Layer Application Layer Infrastructure Layer.
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
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Modern Software Technologies Java™, J2EE™, JSP™, JDBC™ by Radoslav Tr. Ivanov
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
Comp2513 JavaBeans, EJB and J2EE Daniel L. Silver, Ph.D.
J2EE Structure & Definitions Catie Welsh CSE 432
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
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.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
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 ( )
1 Distributed System using J2EE. 2 What is J2EE?  J2EE (Java2 Enterprise Edition) offers a suite of software specification to design, develop, assemble.
Java Servlets and Java Server Pages
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
NJIT 1 Apache Tomcat (Version 6.0) THETOPPERSWAY.COM.
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.
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.
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.
Glink for Java: applet, application and an API for integrating access to Bull, IBM, UNIX and Minitel systems with your Java based e-business applications.
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
Introduction to JAVA Programming
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Labs: Create, deploy and test a simple web service
Java Server Pages Can web pages be created specially for each user?
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.
Tomcat Celsina Bignoli
Enterprise Application Architecture
MSIS 655 Advanced Business Applications Programming
Web Application Server 2001/3/27 Kang, Seungwoo. Web Application Server A class of middleware Speeding application development Strategic platform for.
Presentation transcript:

DT228/3 Web Development Introduction to Java Server Pages (JSP)

Introduction First – need to know the various “java” related terms: J2EE, J2SE, JDK, JRE, JSP,JSTL, Java Servlets,Tomcat, Apache etc…..

Introduction – J2EE Sun Microsystems supply the Java 2 Enterprise Edition (J2EE) platform, enabling developers to develop java based enterprise applications J2EE is a standard set of technologies and APIs (note: J2SE is the standard edition of the java platform but is not geared at large enterprise environments with distributed systems) J2EE includes the following components: Java Server Pages Servlets Java beans JDBC JNDI Java Messaging

Introduction – J2EE Since J2EE is a specification, vendors create products that support the J2EE specifcation e.g. Apache, IBM WebSphere, BEA Weblogic. From a web perspective, the J2EE applications that are particularly relevant are: Java Server Pages Java servlets Java Beans Can be used on its own or with beans/servlets to create a web application Can be used on its own or with JSP/beans to create a web application More complex web applications may use all 3

Introduction – JDK The (JDK) Java Development Kit is the collective name for the various development components supplied in the J2EE (or J2SE). The Java Runtime Environment (JRE) is consists of the components required to run a java application

Introduction to JSP Java Server Pages – A technology for developing web pages that include dynamic content Created by SUN microsystems ‘Equivalent’ of Microsoft’s Active Server Pages technology Pages have a file extension of.JSP JSPs enable web developers to enhance HTML code by adding special JSP elements that are processed by the server Will use JSP v2.0

Advantages of JSP JSP pages are pre-compiled  Fast Part of the Sun’s J2EE -  Can be used with other types of java technologies, such as servlets -  flexible JSP is a specification  multiple vendors support it  commercially stable/not ‘fly by night’ technology Easy to develop: HTML can be easily maintained with JSP. Relatively minimal programming skills required. JSP page code is not visible on client – only generated HTML is visible

Running JSP pages To develop and run JSP pages, need: - Java Developer Kit (JDK which is part of J2EE) or higher AND a Web server that contains a JSP Container -JSP Containers are not automatically included with all Web servers -Examples of web servers that contain a JSP container are Apache Tomcat and Blazix. Not automatically included with all web servers

JSP Container -The JSP Container intercepts all client request for JSP pages -First time a JSP page is requested, the Container converts the page into a java program called a Servlet and compiles --  Translation phase -For all follow-on request, the Container processes each request by invoking the appropriate servlet and then generating the response -  Request processing phase Q: What happens if the JSP page is changed? JSP Containers

How a JSP page is processed by server First time through, JSP is translated to a servlet After, container goes directly to the servlet in the request processing phase If JSP page is changed, servlet is re- compiled

JSP and Apache Apache project have a sub project called Jakarta (see Jakarta project produces -Tomcat web server (nicknamed Catalina) -Tomcat webserver incorporates JSP container (nicknamed Jasper)

Software Versions JSP technology developing rapidly  New version contain major new capabilities  Always note the JSP container version you are working with, and check functionality supported (on apache website) This course using Apache Tomcat Version 5 JSP 2 JSLT 1.1 Servlet 2.4

To run a JSP Using apache Tomcat… Create your web application directory Create the subset WEB-INF directory (won’t run without this) Put JSP page into web application directory Call from the browser

To run a JSP In the background – Tomcat will retrieve the JSP page from the web server If it’s the first time JSP page has been called/run or if page has changed, Tomcat will compile the JSP page (into a servlet) -.java and.class placed in /work directory. -  subsequent calls to page will be faster as no compile needed JSP page will be presented back to the user

Simplest JSP.. Helloworld Prints out message to user when JSP is loaded.. Tomcat demo..

Another Simple JSP example JSP DATE EXAMPLE JSP DATE The current date is. Prints out the current date

Readability of JSP pages Always always always ensure that code is: INDENTED COMMENTED CONTAINS AN ID BLOCK 1)Indented - to reflect level of the code ajsdlkfjads etc 2) Well commented. Comments in JSP appear as Comments in HTML appear as HTML comments will be visible by view source in browser, JSP comments won’t.

3) Titled with an ID block: At the top of each JSP page, should have an ID block explaining who write the script, date, script name, description and any revisions. Can use either JSP or HTML comments (depending on whether users should be able to see the ID block) <%-- ********************************************* *** Script name: addition.jsp *** *** Author: Keith Morneau *** *** Date: July 7th 2006 *** *** Desciption: whatever it does.. *** *** Revisions: *** *** August 8th 2006: added subroutine *** ************************************************ --%> etc Readability of JSP pages