CGS4825, Assignment 3
Due 10/1 at the start of class
You are to write a servlet that will generate a dynamic web page as described
below. Please hand in a printout of your .java file and upload it to the
web.
-
Your servlet will generate a dynamic HTML page as follows:
-
Depending on the current time, your page will look different. If the number
of seconds is even than your page will look one way, if the number
of seconds is odd, the page will look another way. To isolate the
number of seconds in the time, use the
java.util.Calendar
class.
-
Use CSS to control the look of the page. You must change at least these
three styles:
-
Text color for the page
-
Background color for the page. Be sure that the text is easily readable with
this background color.
-
Font for the page (be sure to specify a default if your font is not available).
Be sure that the fonts look different.
-
Embed the style in the page using
<style> ...
</style>
tags in the head section of your page.
-
If there is extra path information in the URL, then use it as the title of
the page. If there is not any extra path info, then display a default title.
-
The extra path info may have a leading / in it. It should not appear in the
title nor heading.
-
If there is data in the query string, then display it in a level 1 heading.
If there is no data in the query string then display a default heading of
your choice.
-
Display an image, based on the browser that is being used to view the page.
-
If the browser is Internet Explorer, then display the following
-
Text: This page is best viewed with Netscape Navigator
-
Display this image
http://www.cs.fiu.edu/~downeyt/images/nnc_lockup.gif
-
Set the width and height of the image to 123 by 25. Download this image. Use a relative
reference to access it. Place it in the root of the web app that you are using.
-
If the browser is not Internet Explorer, then display the following
-
Text: This page is best viewed with Internet Explorer
-
Display this image
http://www.cs.fiu.edu/~downeyt/images/bnrIE.gif
-
Set the width and height of the image to 250 by 60. Download this image. Use a relative
reference to access it. Place it in the root of the web app that you are using.
-
Internet Explorer browsers have MSIE contained in the string that
is sent to the server that identifies the browser.
-
Include some text in the page so that I can view the effect of the CSS.