1 Goal
2 Choosing a Language
3 "Hello, World!"
4 Program Requirements
5 Handin
6 Acknowledgments
Version: 4.0.0.1

Assignment 6, CSC430, Spring 2008

1 Goal

This assignment asks you to write a web program. At this point in the course, the purpose of this assignment seems unclear. Once the assignment has been handed in, however, we’ll introduce an entirely new way of programming the web which is intimately linked with one of the fundamental ideas of programming languages. By completing this assignment now, you’ll be better prepared to appreciate this idea when we introduce it in class.

Though this assignment should not take you very long, we are giving you a lot of time because we know that not everyone is familiar with web programming; you may need to do some learning on your own. Futhermore, to avoid last-minute problems, this project has an early "Hello, World!" hand-in in which you must demonstrate you have a web programming environment set up.

2 Choosing a Language

Unlike the other programming assignments in the course, in this one you will be able to use a programming language of your choice. If you’re already familiar with web programming, choose a language that you’re comfortable with. If you’re not, the web is a font of meta-information, so you should have little trouble in finding resources about programming for it.

For example, your web program may run as:

A CGI script. CGI stands for "Common Gateway Interface" and is the simplest web-programming protocol. You may run CGI programs on the department’s www server by creating a "www" subdirectory within your home directory (if you don’t already have one) and then creating a soft link to it named "public_html", like this:

  ln -s www public_html

You can then put executable files with a ".cgi" extension in your web directory and execute them by visiting the corresponding URL in a web browser. We recommend using CGI if you have never programmed a web application before.

A PHP script. You may use PHP, if you are familiar with it.

A Java servlet. Finally, if you have used Java servlets before, you may use them for this assignment. However, I have no idea whether the department’s server supports java servlets; most apache installations do not. If you go this route, you will probably have to host the servlet on your own machine.

3 "Hello, World!"

We want you to get your web programming setup sorted out early. You must demonstrate that you have by creating a "hello, world!" web application. The application should show a web page with the text "hello, world!" and the current time and date.

We won’t require a formal handin for this. Instead, e-mail the newsgroup with the URL of your application and what language/environment you’re using. You must send this e-mail by 11 PM on Tuesday, May 20.

4 Program Requirements

You will write the authoring half of a simple blogging tool. (The publishing half that would complete the tool is outside the scope of this assignment.) Although this program is quite simple, it is representative of the core of much larger Web software (just as the interpreters we write in this course are themselves quite lean, but represent the core of large programming languages).

Weblogs ("blogs") are web pages that consist of a list of posts ordered so that newer content is at the top. For our purposes, a post is a title, some body text, and a post date. You must assume that the title and body are plain, ASCII-encoded text. In particular, this means that your software will need to escape HTML entities. For example, typing "<b>" into a text field should not make any part of the post bold.

The main page of your web application should have:

Upon submitting the form, the user should see a preview page that shows the post along with its date. The post is not shown on the main page until the user confirms it from the preview page, either through a link or a form button.

We do not require that you save posts to disk, but you may need to, depending on your choice of web application environment. We require that your web application pass this persistence test: a post added from one computer should be visible from the main page on an entirely different computer, if the web server has not been restarted. You do not need to worry about concurrent accesses (i.e. you need not lock any data files).

5 Handin

This will be a pair programming assignment. For this assignment, choose a partner that you did not work with on either of the last two programming assignments. Both team members should send me e-mail on or before Monday, informing me of your choice of partner.

One team member should hand in the assignment. For this assignment, we will use the handin program. You can run it on any of the Linux machines, by running

  /usr/bin/handin clements CSC430-P6 <file> ...

Include a README file containing the names of the members of the group and the URL where the web application is running.

6 Acknowledgments

Many thanks to Shriram Krishnamurthi for this assignment.