Due date: November 30, 1999 (Thursday)
This homework should be easy.
(1) Write a JSP program quote.jsp which uses a Java bean to provide random quotes in the areas of Java, Perl or miscellaneous. You must use Java beans in this assignment. The type (Java, Perl or others) can be set as http parameters, Java being the default. Several examples follow.
Note that the default quote is in Java. Moreover, the http parameter name is quoteType.
The Java bean is the class temp.RandomQuote which essentially provides random quotes in several areas: Java, Perl and Miscellaneous quotes. The default quote is for Java. The bean has already been set up in the weblogic server. The following three methods are available:
public void setQuoteType (String quoteType);
public String getQuoteType ();
public String getQuote ();
Here is the Java Bean file: RandomQuote.java.
(2) Consider the following XML code:
<?xml version="1.0" ?>
<Memo>
<To name="Kwok-Bun Yue" alias=bun>
<From>Michael Jordan
<Subject>Want to play one
on one
<body>
Hey,
you need to improve your dunking skills. Your shooting
average is too low. Should
be > 50%. <:-> M.J.
</memo>
(a) Correct the XML file to make it well-formed.
(b) Give a minimal DTD consistent with the XML code.