Class 1 - Andrew.cmu.edu

Download Report

Transcript Class 1 - Andrew.cmu.edu

Java III
Tom Neuendorffer
Introduction
•
•
•
•
The Goals
The Instructor
Java
The Course
Goals
• Introduce Advanced Topics in Java
• Emphasis on
– E-Commerce
– Available Tools
– Business Applications
• Appropriate Application of Technologies
Instructor
•
•
•
•
•
•
•
CMU
U. of Pittsburgh
CMU – ITC
Galt
Claritech
Evoxis
Consulting
Java
• Language of choice
• Phenomenal set of tools
• Black hole
Course Overview
• Advanced Java Technologies
• Emphasis on E-Commerce Applications
• Project course
– Project will be something you can show
perspective employers
Syllabus
• Week 1
– Course Introduction
– Servlets
• Week 2
– Multi-Threading
– Java Server Pages
• Week 3
– Collections
– Networking
• Week 4
– JDBC
Syllabus (cont.)
• Week 5
– Remote objects
– Swing
• Week 6
– Swing (cont.)
– Java Beans
• Week 7
– Java Beans (cont.)
– Security
• Week 8
– Student Presentations
Course Requirements
• Reading
• Quizzes
• Final Project
– Combine several of the learned technologies
into a functional E-Commerce Application
Independent Work
• Interact with others
• Learn from each other
• Code must be your own
– Well commented
– Code from assignments can be used in the
final project
Required Technologies
• Tomcat
• MySQL / JDBC
Grading Policy
• 25% Quizzes
• 25% Assignments
• 50% Final Project
Final Project -Home Auction
• Homes for sale
• Data base contains photos and
descriptions
• Goals
– Let public view homes
– Register bidders
– Allow bidders to place bids
– Allow seller to view status
Final Project – User Web App
• Any User access
– View homes
• Photos
• Descriptions
• High Bid
– Search property by price range
– Register to be a bidder
• Bidder Access
– All above plus
• Place bid on property
Final Project – Seller App
• Web or direct connection to DB
– If web, should use different technology then used above
• Ex, if above used Servlets and HTML, this should use JSPs and
applets
– If not web, swing components should be used
– In either event, reuse of back-end and middleware components
is encouraged
• View status of all properties
– Including bidder info
• View status of all bidders
• Extra Credit
– Ability to add new homes
– Differentiate between seller and realtor
Getting Started
• Getting Tomcat/ MySQL etc.
– http://hakata.mt.cs.cmu.edu/20783/Handouts/tools.html
Tomcat Documentation
• Programming in Tomcat
– http://localhost:8080/tomcatdocs/appdev/index.html
• Servlet Examples
– http://localhost:8080/examples/servlets/index.
html
Servlet Documentation
• Tutorial
– http://java.sun.com/docs/books/tutorial/servlet
s/index.html
• Javadoc
– http://java.sun.com/products/servlet/2.3/javad
oc/index.html
• Spec
– http://java.sun.com/products/servlet/download
.html
Servlet – Key Classes
•
•
•
•
HttpServlet
HttpServletRequest
HttpServletResponse
HttpSession
HttpServlet
• Extended by user app
• doGet(HttpServletRequest request,
HttpServletResponse response)
• doPost(HttpServletRequest request,
HttpServletResponse response)
HttpServletRequest
• Contains info regarding the user request
HttpServletResponse
• Used to generate servlet response
HttpSession
• Used to store data that persists across
multiple connections and page requests
Cookie
• Stores information regarding cookies
Reading Assignments
•
•
•
•
•
Read Tomcat Docs
Review Tomcat Servlet/JSP examples
Review Sun Servlet tutorial (above)
Skim Sun’s Servlet docs (above)
Read Sun’s JSP tutorial
– http://developer.java.sun.com/developer/onlin
eTraining/JSPIntro/contents.html
• Read Chap 1 Multithreading
– Core Java 2, Vol. 2
Programming Assignment
• Write a Servlet
– Use http forms to provide info
– Convert a perl script from a previous class
– Include comments
– Get running under Tomcat
– Zip up directory and turn-in next week