Problem when i include a script within c:forEach
Hi All,
I want to call a javascript function inside a c:forEach loop. The following code is giving me a "Object Doesn't support this property or method" error
<c:forEach items="${bulkLoadForm.headerInfoVO.columnsDesc}" var="column">
<script>
alert("Hi");
</c:forEach>
The error is not related to this scenario at all. Please let me know a solution to this. It is a bit urgent. Thanks in advance.
[458 byte] By [
vinjavaa] at [2007-11-27 4:24:45]

# 4
>I want to call a javascript function inside a c:forEach loop.
Nope sorry, won't work.
Java/JSP runs on the server. At the server end, any html/script code is just template text to output to an html file.
The server produces an html file, and sends it to the client.
Java stops running.
Java cannot call javascript, javascript can not call java. There is no direct communication.
Java code can produce javascript code to run on a page.
The only communication javascript has back with the server is if it makes a request (click a link, submit a button, Ajax call...)