我遇到了这个jsp scriptlet的问题我不知道为什么它没有运行它
会给出空指针异常
可能是什么原因:
//p is a product object which i previously stored in session as //attribute
<% Product p = (Product)request.getAttribute("product");%>
for (var row =1; row <= 1; row++) {
for (var col = 0; col < 5; col++) {
if(row == 1 && col == 1){
$('#tbl').children().children()[row].children[col].innerHTML = <%=p.getProductCode()%>
}
}
}
//this line below is trying to set table's cell value to the one of properties of that product object
$('#tbl').children().children()[row].children[col].innerHTML = <%= p.getProductCode()%>