CMSC 10200: Lab 2

Wednesday, June 29, 2005

<-- back


This week's exercise: an introduction to interactive web applications using JSP.


Pre-lab exercise

Implement your own RGB class accordingly to the "three-file method" outlined in lecture.

Use the three files presented here as a starting point:

When you're finished with your RGB class, generate documentation for it using javadoc according to instructions I will give in lab.


Lab Exercise, Part 1

Step 1

Set yourself up to be able to develop JSP web application ("webapps") by following the directions given in lab. (This is another thing you will only need to do once.)

Step 2

Develop an HTML form that allows the user to type in three numbers: one each for red, green and blue.

Step 3

Develop a JSP page to "catch" the three integers from the HTML form created in the previous step. It should also construct a color object from the three integers in question.

Step 4

Program the JSP page so it displays a sample of the color.


Lab Exercise, Part 2 (time permitting)

I'm not sure how long Part 1 will take, but if it goes quickly, we'll move on to Part 2.

In Part 2, you will make a "custom page maker" as outlined below.

Step 1

Create an HTML form that allows the user to enter his or her name, a background color, and a favorite website.

Step 2

Develop a JSP page to "catch" the Strings from the HTML form created in the previous step. It should display a page that says the person's name, has the given color as its background color, and links to the favorite website from the previous page.

Step 3

Improve on this custom page maker as you see fit.


Submitting your work

Copy all the files you worked on today into your lab folder. Submit that folder with the command

hwubmit cs102 lab2