O'Reilly logo

MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL by James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required