Naturally, customers won’t register to buy from our shop if they don’t see any products. So now it is time to work on our catalog. For simplicity, we’ll skip creating the
Search functionality, and simply show the entire inventory.
We have already built the foundation with
BookCatalog.java. Now we need a mechanism to create books in the database and display them.
For entering books in the database, we simply insert the SQL statements directly in the
Action class. It might be neater to use Struts pooling by the use of an
Action class, in which we can, for example, process a search enquiry. The disadvantage is that this is really Model code and should be independent from Struts, so direct implementation is preferred in this case.