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]
# 1
just a correction ......i have given the end tag for the script as well which i missed out in my last port </script>
vinjavaa at 2007-7-12 9:32:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
have you checked the generated code?is it the content of the forEach generate more than 1 time?
Leonardo_Da_Vincia at 2007-7-12 9:32:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
i think is the taglib not include scriptsmay include expresion or EL thanks
javaskilleda at 2007-7-12 9:32:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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...)

evnafetsa at 2007-7-12 9:32:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
oh .... ok then i will find another way to solve my problem .Thanks a lot for helping me :)
vinjavaa at 2007-7-12 9:32:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...