This page links to useful resources.

Hypertext Mark-Up Language (HTML) and Cascading Style Sheets (CSS)

w3Schools.com: Go here first for HTML/CSS, SQL, JavaScript, PHP tutorials

Free Code Camp: Covers HTML/CSS (you need to create a free account)

Basic HTML Tutorial: Tutorial site for Basic HTML

HTML Forms Tutprial: Tutorial site for creating HTML Forms

HTML Tables Tutorial: Tutorial site for creating HTML tables

Basic CSS Tutorial: Tutorial site for using CSS

CSS Reference: CSS reference guide from Web Design Group

Bootstrap: A visual editor for creating web front-ends

Brackets: A visual editor for working on HTML/CSS

Java Server Pages (JSP) and Java Standard Tag Library (JSTL)

JSP Tutorial: Tutorial site for working with JSPs (note that this references Apache Tomcat, but much of it should apply to Eclipse Jetty)

JSTL Tutorial: Tutorial site for working with JSTL (linked from above site)

Session Information: Creating and using session information (linked from above site)

JavaScript (JS)

JavaScript Tutorial - w3schools: JavaScript tutorial w/sandbox from w3shools.com

JavaScript Tutorial: Basic JavaScript tutorial

Free Code Camp: Covers various JavaScript versions (you need to create a free account)

Unified Modeling Language (UML)

UML Diagrams: A concise explanation of UML relationships and diagrams

Violet UML Download: Use Violet UML for your project UML diagrams

Git, GitHub, and eGit

Git Branching Demo: Great JavaScript-based demo for using branches in Git

Free Code Camp: Covers Git and GitHub (you need to create a free account)

Git Website: Everything you ever wanted to know about Git, but were afraid to ask

Git eBook: ProGit v2: Available free in PDF form

Git Reference Manual: Git command-line reference

Git Videos: Tutorials on getting started with Git

Git Downloads: Git Clients and Tools

GitHub - Remote Repository Host: Teams will create their remote repositories on GitHub

eGit Home Page: Documentation and tutorials on setting up and using eGit

eGit: Fetching and merging changes from within Eclipse

Relational Databases and Structured Query Language (SQL)

SQL Tutorial - w3schools: Go here first for SQL tutorials w/sandbox from w3schools.com

Free Code Camp: Covers SQL Databases (you need to creaate a free account)

CS320_Derby.zip: Eclipse project with jarfiles for Apache Derby (relational database)

When you implement the persistence layer using Derby for your team project: when specifying the JDBC URL in the code where you connect to the database, you should use an absolute file name for the database name. For example, jdbc:derby:H:/mydatabase.db;create=true (this will create the database as H:/mydatabase.db). If you use a relative file name, your web application will probably not find the database (because it runs in the war directory rather than the root directory of the project).

Email address validation

A Java email validator class using regex (regular expressions)

CS320 Library Example Project

CS320_LibraryExample-2019.zip: Eclipse project that ties the Web Applications Lab together with the ORM Lab. This application places a web front-end on the SQL transactions from Lab06, as well as provides examples for creating a Derby database from CSV files, how to use session information after login, and how to use JSTL to display a list of complex objects in a JSP. It has been updated to incorporate a many-to-many (M2M) relationship between Books and Authors, using a junction table (booksAuthors) that cross-references book_id’s with author_id’s. It also contains some basic (non-exhaustive) JUnit Tests for testing the Derby database queries.

NOTE: You are free to incorporate any of this code into your team project(s) - as long as you cite the source in your code, and refactor the names from **Lab02** and **Lab06** to something that pertains to your project.

After you download the ZIP file, extract it into a new Java workspace separate from the others that you have used in the past. This project is composed of 4 separate Java projects (CS320_Jetty, CS320_Derby, CS320_LibraryExample_Lab02, and CS320_LibraryExample_Lab06).

Before running the project, open up DerbyDatabase.java under CS320_LibraryExample_Lab06->src->edu.ycp.cs320.booksdb.persist and edit the Derby database location in the connect() method so that it has the absolute path where you want your database to be located. Do the same thing in SQLDemo.java in the main() method. If you don’t change it, the default database location will be C:/CS320-2019-LibraryExample-DB/.

DO NOT LOCATE YOUR DATABASE WITHIN THE LibraryExample PROJECT. You will likely be using the LibraryExample as the basis for your team project, and placing the database within the project will eventually result in numerous Git conflicts when you start working as a team from a common Git repository.

Run DerbyDatabase.java as an application to create the Library database from the authors.csv, books.csv, and bookAuthors.csv files. It might take a few seconds for the application to create the DB - you will see it in the console. Afterwards, library.db will show up as a folder under the C:/CS320-2019-LibraryExample-DB/ folder. If you changed the LibraryExample database location, you will find library.db at that location.

Run SQLDemo.java as an application so that you can issue SQL queries to the LibraryExample DB. If this step works - if you can issue queries and SQLDemo can locate the DB - then you have correctly updated the two Java source files from above.

To run the web application, first stop SQLDemo, then run CS320_LibraryExample_Lab02->Main.java as a Java application, followed by entering the following URL in your web browser:

http://localhost:8081/lab02/login

There are currently two sets of login credentials hard-coded into the application: User name: student with PW: ycp and User name: faculty with PW: E&CS. After you have successfully logged in, the user name will be passed around as part of the Session information, and each subsequent servlet checks for a valid Session (a non-null “user” attribute) before responding to the request. Note that this is NOT a secure method for handling credentials, but is used as an example for passing around and checking Session information.

WARNING: You will receive an Academic Integrity Violation, as well as automatically fail the course, if you submit code as part of your Lab06 solution that was taken from any version of the LibraryExample Project that has ever been provided as part of this course.