O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

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

Adding to the Shopping Cart

The page generated by the XSL transformation process is processed by the submit cart action. This is done because the controller servlet will map submitCart.do URL to this class based on the information we have entered in the Struts configuration file (struts-config.xml). As shown below, this class, run as a servlet, processes the list of movies selected as posted by the movies listing page. These movies are added to a collection that is added to the user's shopping cart by the shopping cart bean. If the user does not have a shopping cart, then an error message is logged and an exception is thrown. Since this action may optionally be used to delete movies from the user's shopping cart, there is logic here to provide ...

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