Homework 3
CS320, Fall 2004
Due: Thursday, Oct 28
Please upload your files using the online turnin server.
The files should include all the source code, documentation, and an
HTML
file hw3.html, which
contains a link to your JSP page on the CS server. Note that file
uploading will be disabled automatically after 11:59PM
of the due date, so please turn in your work on time.
[Reading]
- Textbook - Chapter 10, 11, 12, 14, and 16.
- J2EE
Tutorial - Chapter 12 up to "Using Custom Tags", and the sections
about JSTL Core and Functions in Chapter 14.
- JSTL
1.1 Tag References - Again, only Core and Functions.
[JSP Calendar] (65pt)
Convert your calendar servlet from Homework 2
to JSP. You do not have to implement any new features, however,
your JSP implementation of the calendar must meet the following
requirements:
- No scripting elements. The only exception for this
requirement is the Logout feature, which you may implement as
<%
if( request.getParameter("logout") != null )
{
session.invalidate();
response.sendRedirect("Login.jsp");
}
%>
There are ways to get rid of this scriptlet too, but we'll have to wait
until we discuss custom taglibs. Also note that comments and directives
are not considered as scripting elements.
- All features described in Homework 1 and Homework 2 must work in this implementation.
Failing to meet this requirement will incur up to 30pt credit penalty.
And again, particularly good design will receive up to 15pt extra
credit.
[Bean Implementation Issues] (15pt)
The easiest way to convert the servlet calendar to a bean is probably
implementing the bean as follows:
- A write-only (or read/write) property which sets the year
selected by a user
- A write-only (or read/write) property which sets the month
selected by a user
- A write-only (or read/write) property which sets the date
selected by a user. You may not even need this property if you decide
to keep this information outside the bean.
- A read-only property which returns the whole calendar table as
a string.
In your hw3.html, answer the following questions:
(a) What is the problem(s) of this implementation, not in
terms of correctness, but in terms of meeting the design goal of
separating presentation from processing?
(b) Is there any alternative implementation that addresses the problem
described in (a)? If the answer is yes, brief describe the
implementation (and if the answer is no, you lose 5pt).
(c) Is there any way we can address the problem described in (a)
without using a different implementation (because, after all, we like
easy implementations)?