0
...
<%
ArrayList<String[]> list = new ArrayList<String[]>();
int i = 0;
while (result.next()){...

%>
 ...

<input type="button" value="drehen"
 onclick="tauscheBild(**list, i**);">
         </div>
...

I am trying to use my Java variables when calling the onclick function. How do I do it?

Thanks alot!

2 Answers2

1

try this

onclick="tauscheBild('<%=VAR1%>', '<%=VAR2%>')
Sudip Pal
  • 2,041
  • 1
  • 13
  • 16
0

You need to use expression tags in JSP. Find the information you need here. http://docs.oracle.com/javaee/5/tutorial/doc/bnaov.html

Aashray
  • 2,753
  • 16
  • 22