现在,我正在尝试将jsp函数的值与java值一起传递给javascript。但是,我无法得到我想要的结果。而不是获得例如4的arraylist值,我得到像%= list.get(0)%的值。我可以知道我的代码有什么问题吗?有语法错误吗?非常感谢您的帮助。谢谢!
<html>
<head>
<script>
function getValue(value){//expected result would be from arraylist
alert("Values: " + value); // %=list.get(0)% as the alert message.
}
</script>
</head>
<body>
<% ArrayList list=(ArrayList)session.getAttribute("listOfValue"); %>
<html:link action="/hello" onmouseover="getValue('<%=list.get(0)%>');" />
</body>
</html>