The Product and Category Classes

Before you can actually display the product and category pages, you need to create the underlying beans that the JSP pages depend on, much as you did with the Customer class in Chapter 8. These beans are a bit different, however, because they don't handle form input. Instead, they get their content by reading from the database (similar to the findCustomer method).

You can start with the product bean because the category bean will need to use it. You can find it in Listing 9.6.

Listing 9.6. Product.java
 package com.bfg.product; import java.util.Vector; import java.util.HashMap; import java.util.Iterator; import java.text.SimpleDateFormat; import java.text.NumberFormat; import org.apache.turbine.services.db.TurbineDB; ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.