Santa Monica College

Similar documents
Web Container Components Servlet JSP Tag Libraries

Creating Java EE Applications and Servlets with IntelliJ IDEA

Application Security

Implementing the Shop with EJB

Usability. Usability

Building Web Applications, Servlets, JSP and JDBC

Santa Monica College

Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System

CS108, Stanford Handout #33 Young. HW5 Web

An introduction to web programming with Java

How To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post

5. At the Windows Component panel, select the Internet Information Services (IIS) checkbox, and then hit Next.

Web Applications. Originals of Slides and Source Code for Examples:

Controlling Web Application Behavior

Java Web Programming. Student Workbook

Course Name: Course in JSP Course Code: P5

Securing a Web Service

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE CISY 233 INTRODUCTION TO PHP

SSC - Web applications and development Introduction and Java Servlet (II)

Glassfish, JAVA EE, Servlets, JSP, EJB

ACM Crossroads Student Magazine The ACM's First Electronic Publication

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

Web Programming: Announcements. Sara Sprenkle August 3, August 3, Assignment 6 due today Project 2 due next Wednesday Review XML

Complete Java Web Development

Web Applications. For live Java training, please see training courses at

In this chapter, we lay the foundation for all our further discussions. We start

Getting Started with Web Applications

HowTo. Planning table online

Java Server Pages combined with servlets in action. Generals. Java Servlets

MyanPay API Integration with Magento CMS

Mastering Tomcat Development

Liferay Enterprise ecommerce. Adding ecommerce functionality to Liferay Reading Time: 10 minutes

Web Development on the SOEN 6011 Server

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

Virtual Open-Source Labs for Web Security Education

Web Application Architecture (based J2EE 1.4 Tutorial)

NetBeans IDE Field Guide

TypingMaster Intra. LDAP / Active Directory Installation. Technical White Paper (2009-9)

Introduction to J2EE Web Technologies

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc.

CS Developing Web Applications with Java Technologies

Web Applications and Struts 2

Configuring Cisco CallManager IP Phones to Work With IP Phone Agent

Design Approaches of Web Application with Efficient Performance in JAVA

Applets, RMI, JDBC Exam Review

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

Installation, Configuration and Administration Guide

DTS Web Developers Guide

JHU/EP Server Originals of Slides and Source Code for Examples:

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

JVA-122. Secure Java Web Development

NUST School of Electrical Engineering and Computer Science KTH Applied Information Security Lab. Installation Manual

Hello World Portlet Rendered with JSP for WebSphere Portal Version 4.1

Recommended readings. Lecture 11 - Securing Web. Applications. Security. Declarative Security

USING MYWEBSQL FIGURE 1: FIRST AUTHENTICATION LAYER (ENTER YOUR REGULAR SIMMONS USERNAME AND PASSWORD)

Unique promotion code

Supplement IV.E: Tutorial for Tomcat. For Introduction to Java Programming By Y. Daniel Liang

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

Tomcat 5 New Features

T320 E-business technologies: foundations and practice

Using Authorize.net for Credit Card Processing in YogaReg

Title Page. Hosted Payment Page Guide ACI Commerce Gateway

2. Follow the installation directions and install the server on ccc

CrownPeak Java Web Hosting. Version 0.20

Software Engineering I CS524 Professor Dr. Liang Sheldon X. Liang

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012

If you wanted multiple screens, there was no way for data to be accumulated or stored

Eclectic Computing. Time Tracking Tool Software Architecture Document. Version <1.3>

Web Application Programmer's Guide

Penetration from application down to OS

Enrollment Process for Android Devices

Java Servlet 3.0. Rajiv Mordani Spec Lead

Integrating the F5 BigIP with Blackboard

Specialized Programme on Web Application Development using Open Source Tools

Policy Guide Access Manager 3.1 SP5 January 2013

ERIE COMMUNITY COLLEGE COURSE OUTLINE A. COURSE NUMBER CS ADVANCED WEB DEVELOPMENT & PROGRAMMING II

Core Java+ J2EE+Struts+Hibernate+Spring

Specialized Programme on Web Application Development using Open Source Tools

Building Java Servlets with Oracle JDeveloper

Sample HP OO Web Application

INTRODUCTION TO WEB TECHNOLOGY

Configuration Guide - OneDesk to SalesForce Connector

FACULTY STUDENT MENTORSHIP PROGRAM. A Thesis. Presented to the. Faculty of. San Diego State University. In Partial Fulfillment

JSP Java Server Pages

J2EE Web Development. Agenda. Application servers. What is J2EE? Main component types Application Scenarios J2EE APIs and Services.

Google App Engine f r o r J av a a v a (G ( AE A / E J / )

Building Web Services with Apache Axis2

CHAPTER 26 - SHOPPING CART

NeoMail Guide. Neotel (Pty) Ltd

WEB-BASED DATABASE ACCESS: A PEDAGOGICAL STRATEGY

Web Application Development Using UML

Encryption Mechanism Software Requirement Specifications changed to Dokumentation Version 1.3.0

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga

ISI ACADEMY Web applications Programming Diploma using PHP& MySQL

Web Development in Java Live Demonstrations (Live demonstrations done using Eclipse for Java EE 4.3 and WildFly 8)

Single-sign-on between MWS custom portlets and IS services

Security Testing of Java web applications Using Static Bytecode Analysis of Deployed Applications

3. Installation and Configuration. 3.1 Java Development Kit (JDK)

2.8. Session management

Transcription:

Santa Monica College Course Outline For COMPUTER SCIENCE 83, Server-Side Java Web Programming Course Title: Server-Side Java Web Programming Units: 3.00 Total Instructional Hours (usually 18 per unit): 90 Hours per week (full semester equivalent) in 5.00 In-Class Lab: 0 Arranged: Lecture: Date Submitted: May 2011 Date Updated: Transferability: Transfers to CSU IGETC Area: CSU GE Area: SMC GE Area: Degree Applicability: Prerequisite(s): CS 55 and CS 81 Pre/Corequisite(s): None Corequisite(s): None Skills Advisory(s): None I. Catalog Description This course teaches how to design and write applications that extend Web servers. These applications process data submitted from Web forms and access backend databases to dynamically generate Web pages. This course covers the Java Servlets and JavaServer Pages (JSP) server-side technologies. Examples of Appropriate Text or Other Required Reading: (include all publication II. dates; for transferable courses at least one text should have been published within the last five years) 1. Murach's Java Servlets and JSPs, 2nd, Andrea Steelman and Joel Murach, Mike Murach & Associates, Inc 2007 2. Core Servlets and JavaServer Pages, 2nd, Marty Hall, Sun Microsystems Press/Prentice Hall PTR 2006 III. Course Objectives Upon completion of this course, the student will be able to: 1. Define and use Java Servlets and JavaServer Pages (JSP) 2. Write server-side programs in the Java language 3. Process data from online forms

4. Define and use cookies, redirection, applications, and sessions 5. Develop JSP applications 6. Demonstrate basic server-side database access using both Java Servlets and JSP IV. Methods of Presentation: Discussion, Lecture and Discussion, Other (Specify) Other Methods: Lecture and discussion solving Web server related problems from original statement to solution, demonstration and analysis of existing problem solutions through flowcharting and tracing, and discussion of the strengths and weaknesses of different algorithms. V. Course Content % of course Topic 7% Introduction to Web programming 7% Installing and using Tomcat 6% Developing JavaServer Pages 7% Developing Servlets 7% Sessions and Cookies 6% Creating and Using JavaBeans 7% Working with custom JSP tags 7% Using MySQL 6% Using Java with databases 7% Using Java Mail 7% SSL 6% Restricting access to a web resource 7% Working with XML 7% Enterprise JavaBeans 6% Shopping Cart application 100% Total VI. Methods of Evaluation: (Actual point distribution will vary from instructor to instructor but approximate values are shown.)

Percentage Evaluation Method 20 % Projects 30 % Homework 30 % Midterm exams 20 % Final exam 100 % Total VII. Sample Assignments: Sample 1 Program #2 The goal of this assignment is to practice writing HTML front-ends and servlets. When you complete this program, please upload your HTML and Java source files along with your web.xml configuration file, as I don't need your whole Eclipse Tomcat project. Step 1: Create And Deploy The program1.classes.firstservlet Class Follow the steps outlined in the Program1Servlet tutorial available by clicking here. Once you complete this step, you will have a working servlet that responds to HTTP GET commands. Step 2: Extend The program1.classes.firstservlet Class Following the dopost signature described in class, enhance your servlet so that it also knows how to respond to POST requests. The additional method you need to write has the signature: public void dopost( HttpRequest request, HttpResponse response ) throws ServletException, IOException; Like the doget(... ), have this method just bark back a "Hello World!" message. Step 2: Create An HTML Page For this assignment, I would like you to create the HTML page shown below. While all of the controls should be live and enabled, the servlet we will connect them to will not at all verify the user data entry or even process the request in any meaningful fashion. This whole assignment is practicing the skills we need to make more complex applications. Desired HTML Page HTML Authoring needs to become a fairly precise science. Each of the controls needs to be carefully named, as that name will wind up appearing in the java servlet code that processes the request. To get you into the swing of things, please name the control so that it matches the name of the data it is prompting for. I'll be looking for the control names of Name, Address, Flavor, Mood and Age. And yes, the java servlet code will be case-sensitive. You are certainly free to create additional tags and controls, if you choose.

Step 3: Wire Your Buttons To The HelloWorldServlet Finally, I'd like you to connect all of your buttons to the FirstServlet. Please have buttons that work with both POST and GET methods, as I'd like you to see the difference between these approaches. The actual url to connect to will depend on the context name you supplied to Eclipse when you built the HelloWorldServlet. If you followed the initial directions, the diagram below should match your world. The correct url to use to talk to your servlet will be: http://localhost:8080/program1/first HttpServlet /_\ FirstServlet FirstServlet extends HttpServlet public void doget( HttpRequest request, HttpResponse response ) throws ServletException, IOException; public void dopost( HttpRequest request, HttpResponse response ) throws ServletException, IOException; Sample 2 Program #5 The goal of this assignment is to practice using JSP and JSTL with forms and the Derby API I made for you to pull information into and out of the database. You will be asked to make a number of HTML pages. As there are many moving parts involved, please take small steps to the goal. In return for extra credit, you are free to embellish the project as much as you like. I would like you to try using the JSTL Action and JSTL SQL Action tags... Project 1: AdminApp

Step 1: Create HTML Pages Create the HTML pages shown below. Usually customers don't enter their own product prices, so it's not very realistic. But this will give us a sandbox in which to work thru some of the other ideas we have seen in class. As we learn more and more in this course, we will be able to revise and create much more realistic scenarios for this application. Pay careful attention to the names of your form fields as these names will wind up as member names of the Java Beans you create. Desired HTML Pages Supporting Database Tables (Partial) Users Table User_ID Username Password 1 scott tiger 2 howard stahl 3 muffin doggie (Partial) Customers Table Cust_ID Name Phone Address City State 6 Barry Manilow 310-123-4570 84 Mega Hits Road Palm Springs California 2 Muffin Stahl 310-545-4545 1 Poodle Lane Apricot California

(Partial) Orders Table Order_ID Date Cust_ID Amount Description 14 2004-10-01 6 45.50 1 New Hit Record 2 2004-10-02 2 29.95 Science Diet Dog Food Step 2: Create The Login Servlet Create a servlet that will correctly "bean up" the login data you specified in the HTML page. Validate the data entered, ensuring that the user supplied something for each field. If you follow the design approach discussed in class, that validation will be a bean method, rather than buried in the HttpServlet subclass that you create in this step. Have your servlet forward the request to continue the application flow below or forward to a failure page with a link back to the offensive form, depending on whether the user did wrong. --------------- HttpServlet --------------- /_\ LoginServlet LoginServlet extends HttpServlet public void dopost( HttpRequest request, HttpResponse response ) throws ServletException, IOException; Step 3: Create The JSTL JSP Pages Because I think it might work out kinda fun, I'd like you to get the buttons on the Admin Page wired to a JSTL JSP page. You are free to use beans or not, use servlets or not. But I'd like you using the JSTL Actions and/or SQL Actions we discussed in

class. If you wind up trying out the JSTL SQL Actions, then you probably won't need to use the DBQuery class I made for you earlier. But if you do, remember that the JSTL Actions work fine when banging against an Iterator, so you should be able to connect the JSTL Actions to the results of the DBQuery methods. Supporting Database Classes cs83.dbs.classes.dbquery static Iterator getallcustomers( ); static Customer getcustomerbyid( Integer id ); static void insertcustomer( Customer c ); static Iterator getallorders( ); static Order getorderbyid( Integer id ); static void insertorder( Order o ); static User getuserbyusername( String username ); Helpful Java Interfaces java.util.iterator boolean hasnext( ); Object next( ); Step 4: Deploy Your Servlet In order to run your servlet, you will need to create a web.xml which registers your servlet with Tomcat. If you have followed my advice, you should be able to use the following file. Copy and paste what you see below into web.xml. Recall that web.xml belongs in your webapp's /WEB-INF folder. I think everything will match my pictures if you give your project a context name of /Proj5. <web-app xmlns="http://www.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" version="2.4" > <servlet> <servlet-name>project5loginservlet</servlet-name> <servlet-class>cs83.project5.loginservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>project5loginservlet</servlet-name> <url-pattern>/loginservlet</url-pattern> </servlet-mapping> </web-app> VIII. - Student Learning Outcomes