O'Reilly logo

Learning Jakarta Struts 1.2: a concise and practical tutorial by Stephan Wiesner

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

10.2 BookCatalog

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.

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