Java Reference
In-Depth Information
public class PremiumCustomerController {
private static final Logger logger = Logger.getLogger(
private Customer customer;
public String saveCustomer() {
PremiumCustomer premiumCustomer =
(PremiumCustomer) customer;
logger.log(Level.INFO, "Saving the following information \n"
+ "{0} {1}, discount code = {2}",
new Object[]{premiumCustomer.getFirstName(),
//If this was a real application, we would have code to save
//customer data to the database here.
return "premium_customer_confirmation";
Since we used our @Premium qualifier to decorate the customer field, an instance
of the PremiumCustomer class is injected into that field. This is because this class
is also decorated with the @Premium qualifier.
As far as our JSF pages go, we simply access our named bean as usual using its
name, as shown in the following code;
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
<title>Create New Premium Customer</title>
Search WWH ::

Custom Search