CSCI 4230.1
Internet Application Development
Spring 2001
Final Examination

Semi-open book.  Answer all 5 questions.  One hour and 20 minutes.

Return both questions and answers.  Put the question paper on top for stapling.

Name: _________________________________________      Grade: __________________

(1)   [15%]    Consider the following HTML file q1.html, which uses the CSS file q1.css.  Read the HTML contents carefully as it provides CSS information.

<html>
<head>
<link rel="stylesheet" type="text/css" href="q1.css">
</head>
<body>
<span class="box">
This box is shown by using
Cascading Sytle Sheet.
Consult CSS Specification to learn more.
</span>
This is an example of using CSS.  Note that the background
image back.jpeg and the font Verdana are used.  The box has
a width of 300px.  There are spaces of 5px between the
box border and the text.
</body>
</html>

The html file is displayed as:

Show the contents of a CSS file q1.css that can produce this display.

(2)    [15%]  Consider the following JSP program CreatedTime.jsp and Java bean class CreatedTimeBean.java.  Both have errors.  Correct them (you may work this out in the question paper).  If they were correct, the following may be displayed (actual time may change):

CreatedTime.jsp:

<body>
<jsp:useBean id="ct"
             class="CreatedTimeBean">
Using direct method call, the created time is
<%= getCreatedTime() %>.
<p>
Using getProperty, it is
<jsp:getProperty name="ct" property="CreatedTime">
</body>

CreatedTimeBean.java:

public class CreatedTimeBean {
   private String cTime = new Date().toString();
   public String getCreatedTime() {
      return cTime;
   }
}

(3)    [10%] Correct the errors in the following XML document by making change directly in the question paper.

<?xml version="1.0"?>
<quotation>
   <author name=yue>
   <content>
  IBM + X = IBM, MSFT > IBM => MSFT + X > IBM.
   </content>
</quotation>
<quotation>
   <content>
   Both ASP and JSP use <% and %>.
   </content>
</quotation>

(4)    [50%]  Write an ASP program to read quotations from the table Quotations using the DSN temp.  An instance of the table is shown below.  Your program needs to handle any content of the table, not just the following one.

Quotations:
 
Quotation Author
There is no free meal Anonymous
There is no free program Yue
Use \ to escape in Java Yue
What is special about the word: "swims"? Yue

Note that there are two columns in the table.  Quotation is the primary key and both columns do not accept empty string.

The ASP program initially displays:

Note that the author and quotation fields are displayed in text boxes.

Clicking the "Next Quote!" displays the next quote from the table Quotation in a cyclic manner:

Note that the update of the quote is done in the client side, not the server side.  That is, clicking the "Next Quote!" does not submit the form to the Web server.

Click the button two more times to display the fourth quote in the table:

If the table Quotation were empty, the ASP program displays:

(5)    [10%] Write a simple ASP program, t2aq5.asp, to display all query string parameters.

For the URL:

http://../t2aq5.asp?a=x&a=y&a=z&b=k

your program should display the following exactly: