This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i am retrieving the data from the table product in database attadb.
the column names in this table are as follows : product_id,product_name,product_brand,product_price,product_discount,product_seller_name,product_image
the columns which i am retrieving from this table are : product_name,product_brand,product_price,product_discount only
the code is as follows :
rsPagination is the RESULTSET.
in this code, i am using a hyperlink on product_name column. when this code executed, it will retrieve the values of specified columns under the labels :
PRODUCT NAME PRODUCT BRAND PRODUCT PRICE PRODUCT DISCOUNT
now, when the user clicks on the particular PRODUCT NAME value, it will be redirected to the showproduct.jsp page.but i want to show the details of only that product in the showproduct.jsp page.
if the user clicks on product name microwave, it will show the data for microwave in the showproduct.jsp, if the user clicks on airconditioner, it will show the data for airconditioner in the showproduct.jsp.
Do products have an ID? Use that as a parameter to your showProduct.jsp.
You're using a couple of bad practices here though. First, scriptlets have been deprecated for ten years. JSTL is much easier to read and maintain. Second, don't work with DB objects in your JSP. Retrieve your data and store it a collection somewhere, probably a request attribute, and forward to the JSP for presentation.
i have already metioned in this post. product table has also a column product_id.
but i have more than 2 product_name with the same name.
like i have airconditioner with 4% discount, again a airconditioner with 5% discount etc.
same is the case for other products.
i havent any idea about JSTL. i never learnt about the JSTL