Indy Java User’s Group March 27, 2001 Sallie Mae 6:00p.m.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Servlets and Java Server Pages.
Java Server Pages (JSP)
 2003 Prentice Hall, Inc. All rights reserved. Chapter 24: Servlets Outline 24.1 Introduction 24.2 Servlet Overview and Architecture Interface.
Java Servlet & JSP © copyright 2005 SNU OOPSLA Lab.
Technology Overview JAVA Servlets CS-611 S. Witherspoon.
An architecture for webb applications, J2EE
J.Sant Servlets Joseph Sant Sheridan Institute of Technology.
MC365 Application Servers: Servlets. Today We Will Cover: What a servlet is The HTTPServlet and some of its more important methods How to configure the.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
Servlets and a little bit of Web Services Russell Beale.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Servlets and Java Server Pages Object-Oriented Programming V Written by: Haytham Allos (Instructor) New York University (NYU)
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Integration case study Week 8 – Lecture 1. Enrolment request (Workstation) Application server Database server Database New University Student Record System.
MC365 Application Servers: Java Server Pages (JSP’s) and Session Management.
Q: According to Intel, the Pentium conforms to the IEEE standards 754 and 854 for floating point arithmetic. If you fly in aircraft designed using a Pentium,
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
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.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Product Evaluation ADP E-Time Enterprise Kronos Workforce Central.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
Agenda Web Development Chapter 7 Review Class Discussion Issues.
Modern Software Technologies Java™, J2EE™, JSP™, JDBC™ by Radoslav Tr. Ivanov
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
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.
Movie Manager by Patrick Wesley and Chris Grey Internet Database Project for CS 8630 – Summer 2004 Dr. Guimaraes.
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
Standalone Java Application vs. Java Web Application
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
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.
Indy Java User’s Group May 29, 2002 Sallie Mae 6:00p.m.
Chapter 6 Server-side Programming: Java Servlets
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
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.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
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.
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.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Chapter 4 Request and Response. Servlets are controlled by the container.
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.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
JSP / Servlets and Beans
BlueDragon Editions and Advantages Lori Pacheco New Atlanta.
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)
The Holmes Platform and Applications
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Monitoring Java Applications with JAMon
MSIS 655 Advanced Business Applications Programming
COP 4610L: Applications in the Enterprise Spring 2005
Java Chapter 7 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Indy Java User’s Group March 27, 2001 Sallie Mae 6:00p.m

Mission Statement Promote the use of the Java language and components across all levels of interest in the greater Indianapolis area, by serving as a resource for knowledge, experience and career opportunities.

Agenda Pizza Welcome!!6:00-6:15 Announcements6:15-6:30 Joe Caron6:30-7:30 Quality Tip7:30-7:45 Performance Tip7:45-8:00

Announcements Next Meeting - April 24, 2002 Mike Burba – Sun ONE Java Jam - Kurt Kirkham Feedback Results eGroups.yahoo.com BOT Contest – Deadline March 31

Announcements CRN – Annual Survey 1) Call ) Ask for Amy Johnson 3) Request your gift – Sweatshirt Cap T-Shirt Visit Visit

Presentation Lineup Mark Steenbarger Indy Jug Joe Caron KingArthurFlour.com Mike Slattery SearchSoft.net Frank Morton Base2Inc.com

JDBC & Servlets/JSP Joe Caron Indianapolis Java Users Group March 27, 2002

Database access through the web n Sample application overview n JDBC Fundamentals n Servlet/JSP Fundamentals n Implementation & sample code n Pitfalls, Surprises, Work-arounds

Sample Application n Message Board n Membership Based n Pass membership info to catalogue site for “quick check-out” n Accumulate “bakers points” redeemable against online orders n Member “recipe box”

Sample Application n JSP for presentation n Servlets & other java for app logic n MySQL as the RDBMS n Tomcat as Servlet/JSP container n Linux (Red Hat 6.2)

Sample Application n n Staging Server Staging Server n Entity Relationship Diagram Entity Relationship Diagram n Application Diagram Application Diagram n Presentation Diagram Presentation Diagram

JDBC Fundamentals n Standard means of accessing any RDBMS for which there is a JDBC driver n Drivers which implement Sun’s JDBC standard capture a DB connection as Java Object n Change DBMS without changing any application code (except driver) n Sun JDBC API overview Sun JDBC API overview

JDBC Fundamentals n Key objects u Connection u Statement u PreparedStatement u ResultSet / Rowset u ResultSet MetaData u DB MetaData

JDBC Fundamentals n Sun JDBC overview Sun JDBC overview n Basic Example - MySQL Basic Example - MySQL n Basic Example - ORACLE Basic Example - ORACLE n Statement vs. PreparedStatement Statement vs. PreparedStatement n Stand-Alone Example Stand-Alone Example n API Documentation API Documentation n JDBC Optional: DataSource JDBC Optional: DataSource

Servlet/JSP Fundamentals n “Servlet Container” (Tomcat, for example), working in conjunction with Web server (Apache or IIS) n Integrated in J2EE compliant server (BEA, Iplanet, Orion) n Many options regarding both the products and how to set them up Many options

Servlet/JSP Fundamentals Common Set-Up Servlet Engine Web Server Client.html & others.jsp & /servlet/ Redirect based on conf file conf file Common directory structure

Servlet/JSP Fundamentals n Servlets like any other Java class, except: n Must extend HttpServlet n Must contain a doPost or doGet method n Come equipped to handle the laborious points of http n Http requests and responses are made into Java objects n Best alternative to traditional CGI

Servlet/JSP Fundamentals n Anatomy of a Servlet u Optional init method, executes the first time a servlet is invoked u doGet/doPost methods execute when request is made u method signature accepts http request and response as parameters u Optional destroy method u Samples Samples

Servlet/JSP Fundamentals n One instance of Servlet for each Servlet name n Same instance serves all requests to that name n Instance members persist across all requests to that name. n Local /block variables in doPost & doGet are unique to each request

Servlet/JSP Fundamentals n Instance members vs local variables Instance members vs local variables n Major request and response methods Major request and response methods n More major request and response methods More major request and response methods n Making use of servlet context Making use of servlet context n Keeping sessions: the bane of all Web programming Keeping sessions: the bane of all Web programming

JSPs: Servlets in disguise... n Better alternative for presentation. n Insert special brackets into HTML page to mark off Java code. n A JSP is compiled into a Servlet the first time it is called. n Crash course in JSP syntax

JSP as presentation model Servlet Performs the hard work Client request JSP Successful results Helper objects Persistent “bean” objects DB Connections, etc JSP Unsuccessful results App logic Presentation Subsequent client request Simple calls to bean properties No servlet need if bean still set

JSP alternatives n JSP can still result in unwieldy code creeping into HTML n Most HTML editors don’t like it n JSP:Taglibs and other “templating” programs may help. n Much depends on how HTML documents are produced and what business logic you are presenting

In Depth Examples n Encapsulation of SQL calls n List results and view thread detail n Post reply and add to favorites n Set all bean properties w/ request n Edit users n Query central

Pitfalls, surprises, and work-arounds n HTTP works via requests and responses. Client caching of responses poses a problem. n Guard against evil use of the “back” button n Don’t assume everyone’s client will respond properly to the “defaults” n Guard against easy spoofs of any GET request which alters data.