Assignment # 9
Project
This assignment is part of Project#2.
Your Favorite Recipe
Learning Goals
- Learn to access an XML document as a tree.
- Gain experience in writing XPath expressions.
- Gain experience with the JSTL X Library.
Assignment
In this assignment, you will build a JSP that will display your favorite recipe. Alternatively, you can use a pre-selected recipe for which
an xml document has already been created.
To complete the assignment, complete the following steps:
- Create an xml document for your favorite recipe or download and use the fricos.xml file. Note that the download xml file contains the dtd
for the document.
- Create a JSP that will generate valid xhtml.
- Code the JSTL in your JSP to parse the xml document.
- Include JSP statements (JSTL) to extract data from the xml document and insert into the document.
Hints:
- You may need to add an additional jar file, (xalan.jar). It can
be downloaded from Apache's web site, but it is a little difficult to locate, so you might want to just download this version of xalan.jar.
With this .jar file, everything works fine.
- You will likely also need TomCat 5.0 (and JSP 2.0). To access these, be sure to set your taglib to:
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
- Use the JSTL X library.
- You can use the ham and cheese sandwich page as a starting point. This page is valid
HTML 4.01 Transitional. You should be easily able to convert it to xhtml Transitional. You can convert to xhtml Strict if you want some more
practice in building a style sheet.
- You only need to change the file type to change an xhtml document to a jsp.
- Remove the recipe specific content from your starting page so that you can use your recipe XML document for the recipe information.