I have the I am currently using an XML file to store products. How do you reproduce through the list of products you will display a list of products in the JSP page, list the name of each product, description and size and price? How will you display a list of products in the JSP page Use C: forEach & gt; Use EL product class and
CartItem class that keeps the product , And a
shoppingcart category that includes ways to add / remove items from the cart.
& lt;
$ {} to use and display the beam properties to iterate over a collection. HTML
& lt; Table & gt; Use to markup as a table.
& lt;% @ taglib prefix = "c" uri = "http: //java.sun .com / jsp / jstl / core"%> ... & lt; Table & gt; & Lt; C: forEach item = "$ {products}" var = "product" & gt; & Lt; TR & gt; & Lt; TD & gt; $ {Product.name} & lt; / TD & gt; & Lt; TD & gt; $ {Product.description} & lt; / TD & gt; & Lt; TD & gt; $ {Product.size} & lt; / TD & gt; & Lt; TD & gt; $ {Product.price} & lt; / TD & gt; & Lt; / TR & gt; & Lt; / C: foreach & gt; & Lt; / Table & gt;
Comments
Post a Comment