JSP 2.0 Examples - Display Products Tag File


This JSP page invokes a tag file that displays a listing of products. The custom tag accepts two fragments that enable customization of appearance. One for when the product is on sale and one for normal price.

The tag is invoked twice, using different styles


Products

Item: ${name}
Price: ${price}
Item: ${name}
Was: ${origPrice}
Now: ${salePrice}
Item: ${name}
Price: ${price}
Item: ${name}
Price: ${price}
Item: ${name}
Was: ${origPrice}
Now: ${salePrice}

Products (Same tag, alternate style)

${name} @ ${price} ea. ${name} @ ${salePrice} ea. (was: ${origPrice}) ${name} @ ${price} ea. ${name} @ ${price} ea. ${name} @ ${salePrice} ea. (was: ${origPrice})