You must complete this program with the same partner you had for "Laziness". This will be your team for the next few assignments.
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.
Choose Your 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-int server by creating a directory for yourself inside /pro/web/cgi-bin and putting your world-readable and executable files there. We recommend using CGI if you have never programmed a web application before.
- A Java servlet. If you have used Java servlets before, perhaps in CS 32, 138, or 196-9, you may use them for this assignment. You will be responsible for starting and maintaining a Tomcat server instance for your servlet. Both traditional servlets and JSPs are acceptible.
- A PHP script. Finally, you may use PHP. Unlike the other options, you will have to host your application on your own machine, as the department’s web server does not have PHP enabled.
We’re 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 TAs with the URL of your application and what language/environment you’re using. We must receive this e-mail by 2AM on October 3rd.
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, somebody 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:
- A list of posts, sorted correctly by date.
- A form for creating new posts, with a field for the title and a text area for the body.
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).
One team-member should handin the assignment. From the root directory of your code base, execute:
Include a README file containing the names of the members of the group and the URL where the web application is running.