Project 2: Tomcat-Based Markdown Editor

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment

Description

5/5 - (4 votes)

In Project 2, we will develop an online “markdown” editor using Apache Tomcat. Through this
process we will learn:
1. How to develop a Web application using a “traditional” stack, in particular, MySQL and Apache
Tomcat (Java servlet)
2. How to use CSS to format and layout a Web page
In later projects, we will use more “modern” Web development stack, such as MongoDB, Node.js,
and Angular, but we want to make sure that everyone has an experience with developing Web
applications on a more “traditional” stack. This will help students understand and appreciate why
modern frameworks are structured as they are. All development for Project 2 will be done on the
“tomcat” container that you created from “junghoo/cs144-tomcat” image in Project 1. Make sure
that container still starts and works fine by issuing the following command in a terminal window:
$ docker start -i tomcat
Part A: Learn Apache Tomcat
Before starting to code, first learn how we develop a Web application using Apache Tomcat by going
over our tutorial:
Developing a Web Application on Tomcat.
The tutorial teaches how you can develop a Web application using Java Servlet and JSP, and how
you can package the set of files needed for your app into a single Web Application Archive (WAR)
file for easy deployment on Tomcat.
Part B: Learn JDBC
12/13/2018 Project 2: Tomcat-Based Markdown Editor
http://oak.cs.ucla.edu/classes/cs144/project2/index.html 2/13
In order to access MySQL data from a Java program, you will need to use JDBC (Java DataBase
Connectivity) API. Go over the following tutorial to learn how to use JDBC to access MySQL in a
Java program.
A short tutorial on JDBC
Part C: Implement Markdown Editor and Previewer
Now that you have learned how to develop applications on Tomcat and MySQL, it is time to get your
real work done. In Part C, you will need to implement an “online markdown editor” that allows users
to save and edit blog posts written in markdown.
Markdown is a lightweight and intuitive markup language originally proposed by John Gruber in
2004 to help people “write using an easy-to-read, easy-to-write plain text format, and optionally
convert it to structurally valid XHTML (or HTML)”. Due to its simplicity, markdown has become the
de-facto standard for writing readme files on many web sites (e.g., GitHub and BitBucket). In fact,
this page was originally written in markdown and has been converted to HTML using Pandoc! Since
we will use an “off-the-shelf” markdown parsing library in Java for this project, you don’t have to
learn markdown syntax, but in case you are interested, here is a 2-minute introduction to markdown
syntax. For your reference, John Gruber’s description of markdown syntax is available here (highly
recommended if you want to learn more precise syntax) and the result of recent standardization
efforts, referred to as CommonMark, is available here (extremely detailed and precise, yet boring to
read).
“Pages” Within Your Application
Your Web site should allows users to create a new post (written in markdown), preview the post
(rendered in HTML), and manage existing posts. These tasks are supported through three main
pages on your Web site: edit, preview, and list pages
Edit page
The “edit page” allows editing the title and body of a post.
The page should contain two input boxes
1. a title box of text type. This text input element must have the ID attribute with
value “title”.
2. a body