The goal of this assignment is to explore the use of Java Server Pages as the implementation technology for building View components. In doing so, you should begin to see some of the benefits of using a Model - View - Control architecture and a layered design. If your design for the Basic AddressBook was clean and components well-separated, your Model components should require no change and your Control components are likely to be affected primarily with regard to navigation, or the transfer of control from one page or view component to another. Consequently, you should also begin to see how a well-designed O-O system can lead to component reuse -- in this case, reuse through copy and paste!
The basic address book. application remains the same. You can use the same database tables, but you may wish to implement another set of tables for debugging purposes so that your AddressBook1 remains operational. (Do keep that application working.)
So, all of the basic requirements of AddressBook1 remain, with several additional requirements.
Clean-up Control and Model Components
Your control and model components should not require major changes for this assignment. Use this occasion to edit and refine your code for these modules and complete any deficiencies and/or correct any errors from your AddressBook 1.
JSPs
JSPs are an important and popular technology for building View components. A major goal of this assignment is to learn to use them effectively and in appropriate ways (i.e., ways that are generally regarded as best practices.)
You should replace each of your View components from your AddressBook1 with separate JSP pages. We will accept designs that implement all function directly in the JSP.
Eclipse Development Environment
One reason we have scaled back the basic JSP requirements for this assignment is to give you the opportunity to begin exploring and learning Eclipse. You will need it for the next assignment, so I strongly encourage you to use it for this assignment to get over the initial learning curve.
There are two versions available off the course's Tools page. V. 2.1.1 supports Struts, which we will explore in the next assignment, but has a bug in its debugger(!) for projects that include JSPs. V. 3.0 has fixed the debugger bug but so far I have not been able to find an open source plugin for Struts. Both versions will be discussed and demonstrated in class. You may wish to explore both.
I suggest porting your first AddressBook into v. 2.1.1 and explore basic Eclipse functions there, including running it on Tomcat from within Eclipse and using the interactive debugger. Then for your development of the JSP version of the AddressBook, switching to v. 3.0, where the debugger appears to work as expected.
Extra Credit
We will give extra credit for projects that include a custom Taglib of reusable tags that you design and build. These tags serve two purposes. First, they can/should hide most, if not all, Java code from the JSP page designer, enabling them to build pages (almost) entirely from conventional HTML and your custom Taglib tags. Second, they can be used to greatly condense the actual HTML code that appears in your pages by identifying higher-level constructs that are repeated and replacing those constructs with tags. For example, if you use a table to format items in a form, tags can be used to replace most of the table-specific HTML. For this particular assignment, using tags for this latter purpose is more appropriate.
In my solution for this assignment, I used the following tags (plus several other similar tags):
- jbs:itemHidden
- jbs:table
- jbs:itemText
- jbs:itemPassword
- jbs:itemSpace
- jbs:itemButton
- jbs:itemButtonSetSearch
- jbs:itemMessage
- jbs:itemLink
Here are several examples that illustrate the use of these tags:
<jbs:itemHidden name="personID">
<jsp:getProperty name="beanPerson" property="personID"/>
</jbs:itemHidden><jbs:itemText viewName="First Name: " name="nameFirst">
<jsp:getProperty name="beanPerson" property="nameFirst"/>
</jbs:itemText>You should design a similar set of tags for your application (not necessarily the same set I used) that serves the goal of simplifying the presentation of information as well as removing as much of the Java code from your pages.
Documentation
Be sure to update your documentation for this project. Be sure that your Project Description describes the application and provides user instructions for using your system. (It should be 1-2 pages in length.) Similarly, you should update your System description, describing your components, the relationships among them, and key implementation details. You should also comment on steps taken to transform AddressBook1 into AddressBook2 and any problems and/or insights you encounter along the way. Also, be sure to include/update comments in your code.
Run the Application