/* BIVIO-NO-COPYRIGHT * $Id: ShoppingClientBannerHelper.java,v 1.2 2001/10/23 21:47:42 gmurray Exp $ * Copyright 2001 Sun Microsystems, Inc. All rights reserved. * Copyright 2001 Sun Microsystems, Inc. Tous droits r?erv?. */ package com.sun.j2ee.blueprints.petstore.controller.web; /** * * This class relates to some web tier specific display selection where * this helper will choose the banner to be displayed based on the category. * The mapping of banners to categories could also be maintained in * a properties file or database. * * For simplicity the names are mapped directly in this class. */ public class ShoppingClientBannerHelper implements java.io.Serializable { public ShoppingClientBannerHelper() { } public String getBanner(String favoriteCategory) { if (favoriteCategory.equals("Dogs")) { return "banner_dogs.gif"; } else if (favoriteCategory.equals("Cats")) { return "banner_cats.gif"; } else if (favoriteCategory.equals("Reptiles")) { return "banner_reptiles.gif"; } else if (favoriteCategory.equals("Birds")) { return "banner_birds.gif"; } else if (favoriteCategory.equals("Fish")) { return "banner_fish.gif"; } return "banner_dogs.gif"; } }