现在有一个first.jsp、second.jsp和firstservlet.java。在first.jsp里面先servlet里面发了些请求。servlet从数据库取出数据并进行如下处理:request.setAttribute("test", test_num);
 request.setAttribute("cstr", cstr);
 request.setAttribute("jstr", jstr);
RequestDispatcher dispatcher=request.getRequestDispatcher("/second.jsp") ;
dispatcher.forward(request,response);
在secon.jsp里面有
<script type="text/javascript">
function ol()
{<%
String[]cword=(String []) request.getAttribute("cstr");
int total=(Integer)request.getAttribute("test");
%> for(var j =0; j<total; j++) 
{
var x=document.getElementById("myTable").insertRow(1);
var y=x.insertCell(0);
var tt=document.createElement("input");
tt.type="text";
tt.id="as"+j;
tt.name="tname";
//y.innerHTML=t_arry[j];
y.innerHTML=cword[j];
var obj=x.appendChild(tt);
}
}
</script>
<body bgcolor="grey" onload="ol()" >为什么不能绘制表格?求教啊大神。