• Post Reply Bookmark Topic Watch Topic
  • New Topic

variable declaration with in the loop using C:set in JSTL  RSS feed

 
bhavani rayala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My requirement is -
I have list of products and I am getting productname from each loop.I should use this productname in javascript to pass the same variable to other javascript funciton.

reference given below:
<c:forEach var="item" items="${actionBean.context.cart.items}" varStatus="loop">
<c:set var="productName${loop.index}" value="${item.summary.productName}" />

This code snippet is giving me some errors.

Can anyone please help me on this.

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhavani rayala wrote:This code snippet is giving me some errors


Which are...?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!