[JSP] How to pass back ID to previous page.

[JSP] How to pass back ID to previous page.

Hi experts, May I ask something. How to link a page to previous page which the content in previous page is selected from database where IDPRODUCT=". I don't know how to pass back the IDPRODUCT.

Suppose I have ViewProducts.jsp and ViewPhotosOfProduct.jsp. ViewProducts.jsp is displaying list of all products. The previous page from ViewProducts.jsp is displaying list of shop (called UKM here).

When user click a UKM, it linked to ViewProducts.jsp

<a href='lihatProduk.jsp?ID_UKM=" + rs.getString("ID_UKM") + "'title='Lihat Produk' class='icon-5 info-tooltip'</a>

Then at ViewProducts.jsp,

When user clicked one of them, it linked to ViewPhotosOfProduct.jsp is displaying a few photos (from all sides) from that product only.

at ViewProducts.jsp this is the code (combined with html button)

<a href='ViewPhotosOfProduct?ID_PRODUCT=" + "getID_PRODUCK" + "''title='ViewPhotosOfProduct' class='icon-5 info-tooltip'> <a href='updateProduct.jsp?ID_UKM="
                                        + rs.getString("ID_PRODUCT") + "''title='Edit' class='icon-1 info-tooltip'> <a href=javascript:confirmDelete('ViewProducts.jsp?delete=" + rs.getString("ID_PRODUCT") + "') 'title='Delete' class='icon-2 info-tooltip'> </td></tr>");

that is fine. But the problem is at ViewPhotosOfProduct.jsp. I add a button that linked back to ViewProducts.jsp but doesn't works. I tried this

 <a href='ViewProducts.jsp?ID_UKM=" + rs.getString("ID_UKM") 
          + "'> SEE ALL PRODUCTS </a>

But doesnt work.

Thank you before for your help.

View Answers









Related Tutorials/Questions & Answers:

Ads