<%
int index = 0;
for(int i=0; i<10;i++) { String x = index +"";
String y = (index+1)+"";
%>
<tr>
<td align="Center" bgcolor="#EFEFEF" height="20" width="116" >
<html:text property="employeeIdCol" size = "8" value = "" onchange = "__doPostBack('method','<%=x%>','')"/>
<img border="0" src="<%=image%>Help_Down.gif" style="cursor:'hand'" height="23" width="20" onclick="btnPersonnelData_Click(this)"> </td>
<td align="left" bgcolor="#EFEFEF" height="20" width="104"></td>
<td align="left" bgcolor="#EFEFEF" height="20" width="222" >
<font size ="2">
<html:text property="jobTitleIdCol" size = "8" value = ""/>
</font>
<font size ="2">
<img border="0" src="<%=image%>Help_Down.gif" style="cursor:'hand'" height="23" width="20" onClick="callBtnJobTitle_Click(this)"/>
</font>
<font size ="2">
</font>
</td>
</tr> <%
index ++;
}
%>__doPostBack()为一个脚本方法,为什么我得不到x的值,而是取到的<%=x%>字符串, 哥哥姐姐们帮忙了!!!!
int index = 0;
for(int i=0; i<10;i++) { String x = index +"";
String y = (index+1)+"";
%>
<tr>
<td align="Center" bgcolor="#EFEFEF" height="20" width="116" >
<html:text property="employeeIdCol" size = "8" value = "" onchange = "__doPostBack('method','<%=x%>','')"/>
<img border="0" src="<%=image%>Help_Down.gif" style="cursor:'hand'" height="23" width="20" onclick="btnPersonnelData_Click(this)"> </td>
<td align="left" bgcolor="#EFEFEF" height="20" width="104"></td>
<td align="left" bgcolor="#EFEFEF" height="20" width="222" >
<font size ="2">
<html:text property="jobTitleIdCol" size = "8" value = ""/>
</font>
<font size ="2">
<img border="0" src="<%=image%>Help_Down.gif" style="cursor:'hand'" height="23" width="20" onClick="callBtnJobTitle_Click(this)"/>
</font>
<font size ="2">
</font>
</td>
</tr> <%
index ++;
}
%>__doPostBack()为一个脚本方法,为什么我得不到x的值,而是取到的<%=x%>字符串, 哥哥姐姐们帮忙了!!!!
不过你的程序有问题
int index = 0;
for(int i=0; i<10;i++) { String x = index +"";
String y = (index+1)+"";
JSP中数字型变成字符型要进行转化的,你这样String x = index +"";是不行的,这不是JS
要先index.toString()才行