I'm trying to display list of products in a jsp using ProductLookup droplet as shown below. I'm also trying to give a hyperlink to navigate to product details page of the individual product.
<dsp:droplet name="/atg/commerce/catalog/ProductLookup">
<dsp:param param="element.id" name="id"/>
<dsp:oparam name="output"><br/>
<dsp:a href="display_product.jsp?itemId=${id}">
Product display Name:
<b><dsp:valueof param="element.displayName"/></b><br/>
Product description Name:
<dsp:valueof param="element.description"/>
</dsp:a>
</dsp:oparam>
</dsp:droplet>
However, I'm facing issue while passing the id of the product to href
tag of dsp:a
. The resultant HTML has hardcoded ${id}
as display_product.jsp?itemId=${id}
. I'm getting list of products, but the URL is where I'm facing issue. How do I pass the value in element.id
into the href
attribute of dsp:a
?
I've also tried the following, but no success.
1.
<dsp:a href="display_product.jsp?itemId=<%=out.print(element.id) %>">
2.
<dsp:a href="display_product.jsp?itemId=<%=out.print(id) %>">
3.
<dsp:getvalueof var="id" id="id" >
<dsp:a href="display_product.jsp?itemId=${id}">
Product display Name:
<b><dsp:valueof param="element.displayName"/></b><br/>
Product description Name:
<dsp:valueof param="element.description"/>
</dsp:a>
</dsp:getvalueof>