<a onclick="getCategoryIndex(${myIndex.index})" href="#">${categoryName}</a>
above line was giving me an error. So I wrote down in below way which is working fine for me.
<a onclick="getCategoryIndex('<c:out value="${myIndex.index}"/>')" href="#">${categoryName}</a>
Maybe someone else might get same error. Look at this guys!