Tutorial: Modifying a controller command
This tutorial demonstrates how to modify an existing
controller command. In this tutorial, you restrict the number of items in a customer's shopping cart
to five or fewer unique items. To implement this solution, you override the
OrderItemAddCmdImpl class with your own implementation. The implementation
includes logic to check for the number of items in the shopping cart. If a customer attempts to add
a sixth item to the shopping cart, an exception is thrown. This exception uses a new error
message.
Learning objectives
After completed this
tutorial, you should be familiar with the following concepts:
- OrderItemAddCmdImpl class
- Controller commands
After completing this tutorial, you should be familiar with the
following tasks:
- Creating implementation for a controller command
- Updating the command registry so that the new implementation gets used in your application
- Deploying a modified controller command to a WebSphere Commerce application
Time required
Expect this tutorial to take 30 minutes to complete. The tutorial takes longer if you explore concepts that are related to this tutorial.
Skill Level
This tutorial is intended for WebSphere Commerce Store developers who are responsible for modifying controller commands. To complete this tutorial, ensure that you are familiar with the following terms and concepts:- Rational Application Developer.
- The Java programming language.
- The database type that is used in your WebSphere Commerce development environment.