Java Server Programming Jeff Schmitt Towson University October 15, 1998.

Slides:



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

Technology Overview JAVA Servlets CS-611 S. Witherspoon.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
Servlets and a little bit of Web Services Russell Beale.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
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.
Definitions, Definitions, Definitions Lead to Understanding.
Stanford University EH&S A Service Oriented Architecture For Rich Internet Applications Sheldon M. Heitz.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
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.
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.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Chapter 9 Using Perl for CGI Programming. Computation is required to support sophisticated web applications Computation can be done by the server or the.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
1 Servlet How can a HTML page, displayed using a browser, cause a program on a server to be executed?
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and client-side Oracle JDBC drivers provide the same basic functionality.
Database Management Systems 1 Oracle Programming.
Chapter 4: Core Web Technologies
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
JDBC. JDBC Drivers JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
CS4273: Distributed System Technologies and Programming Lecture 13: Review.
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems Web based Applications,
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
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.
CGI Programming. What is it? CGI –Common Gateway Interface Standard way to pass information back to the Web Server –GET Query String –POST Standard Input.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
JSP Server Integrated with Oracle8i Project2, CMSC691X Summer02 Ching-li Peng Ying Zhang.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
WEB SERVER SOFTWARE FEATURE SETS
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Introduction to JDBC Instructor: Mohamed Eltabakh 1.
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.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Java Servlets References: Karen Anewalt, Mary Washington College.
WWW and HTTP King Fahd University of Petroleum & Minerals
Servlet Fudamentals.
By Dr. Kodge Bheemashankar G
PHP / MySQL Introduction
Web Technology and DBMSs
Presentation transcript:

Java Server Programming Jeff Schmitt Towson University October 15, 1998

Java Server Programming Presentation Topics Three Tier Information Architecture CGI and CGI-Wrap Java Server and servletrunner JDBC and Oracle Future developments

Three Tier Architecture 1Lightweight Client Web browser as universal client Java Applets? 2Business Logic Web server--executing programs 3Database Server Oracle -- accessed by JDBC

HTML Forms <FORM ACTION= “ METHOD=“GET” (or put)

Common Gateway Interface A standard for interfacing external applications executable programs placed in special directory defined on the server programs run under www (the webserver) userid read standard input and print standard output server passes information via Environment variables REMOTE_HOST QUERY_STRING CONTENT_TYPE

Problems with CGI Security concerns Loading/initializing program and JVM for each access Problems sharing/access to files Control of concurrency

CGI-WRAP Nathan Neulinger CANS official policy--triton, saberCANS official policy Access control (allow, deny) CGI program runs as the user See: CGIwrap User InstructionsCGIwrap User Instructions

CGI Processing- 3 Steps 1Read the CGI Parameters Get Method: Query String transmits the data with the URL string bin/stockmarket?stock=IBM&action=buy Post Method: data is transmitted separately, does not appear in the URL string 2Process the information 3Transmit the results Content-type: text/html (then a blank line) etc. output

Java Class: CGIParameters Needed to access CGI Adapted from John Carnahan's MOD_JAVAMOD_JAVA Parses query string, POST data values, HTTP cookie Builds a hashtable structure for efficient access Hides the details of a urlencoded data

Running Java programs as CGI Shell script 'javarun' is used CLASSPATH is established Shell exits and java starts Server information passed to Java Class name taken from cgiwrap See: javarun sourcejavarun source

Learning Server Programming Start with basics Build skills by copying and modifying examples Guestbook series of projects Guestbooks 1 and 2 save data in textfileGuestbooks 1 and 2 Guestbook 4 sends notification by Guestbook 3 uses JDBCGuestbook 3 Guestbook6 same as Guestbook3 but uses servlet technologyGuestbook6

Java Server or Apache plus JRun 100% Java code from Sun Microsystems Same features as regular web server plus servlets JSP scripting embedded into HTML web pages JSDK 2.0 will be part of future JDK 1.2 now in beta Configuration file servlet.properties –server creates new servlets by chaining one or more servlets –server can pass additional parameters to servlets See: Java Web Server at Sun; JRun at Live SoftwareJava Web Server JRun

Servlet Advantages Initialization method when servlet is loaded by server Servlet stays running Concurrency control and communication between threads Presentation Templates Page Compilation (JSP) Powerful, standard JSDK class library from Sun Server and Servlets are centrally administered

Servlet Session Tracking Session tracking is a mechanism for building a sophisticated, stateful model on top of the web's stateless protocol. With session tracking, session state is maintained by the server. –creates new sessions –invalidates old sessions, –maintains policies of session persistence.

Java Servlet Development Kit - JSDK CLASSPATH jsdk.jar defines classes javax.servlet and javax.servlet.http servletrunner: sun.servlet.http.HttpServer -Can serve only servlets -Lightweight and efficient See: JSDK API Documentation on tritonJSDK API Documentation

CGI script: servletrun CANS server policy Each student chooses a specific port ( ) CGI program similar to javarun Starts server if necessary Redirects request to servlet Works with method of Get (not Post) See: servletrun sourceservletrun source

CGI script: servletstop Stops server Next access to servlet by servletrun will restart server and new classes will be used See: servletstop sourceservletstop source

Servlet Examples HelloServlet SnoopServlet SessionServlet Dukes Bookstore See: Java Servlet WebpageJava Servlet Webpage

JDBC - Java Database Connectivity Choices of JDBC driver JDBC Thin or JDBC OCI Oracle's JDBC Thin driver uses Java sockets to connect directly to Oracle. Runs as 100% Java, platform independent The JDBC OCI drivers call native code libraries directly from Java Providing a high degree of compatibility with a specific Version of Oracle.

Steps in using JDBC 1Load the Driver Class.forName ("oracle.jdbc.driver.OracleDriver"); 2Connect to the DB Server Connection conn = DriverManager.getConnection ( account, password); 3Make and execute an SQL statement rset = stmt.executeQuery ("select * from guestbook6");

Steps in using JDBC (Continued) 4Process the ResultSet while (rset.next ()) { out.println(" ") "+rset.getString (1)); } See: JDBC Instructions and Oracle JDBC DriverJDBC InstructionsOracle JDBC Driver

Future: JSQL JSQL is an integration of SQL statements in Java programs. It is more concise than JDBC, and more amenable to static analysis and type checking. The Oracle database server will store a user’s JSQL program and execute it in the server. See: Oracle 8 and Java -- Technical Whitepaper

Future: Oracle8i Integrated Sun Java Web server (servlets, JSP) Oracle’s own Java virtual machine VM Internet File System -- Windows desktops can attach directly to database WebDB -- server-based web development environment See: Oracle8i at OracleOracle8i

Future: Page Compilation Java Server Pages.jsp Server creates servlets dynamically Scripting tags embedded in an HTML page See: catalog.jsp source codecatalog.jsp source code

For More Information See my web pages: CGIWrap Setup Instructions Database Page JDBC Page Server/Servlet Page COSC 671 Assigned Projects and Readings