JavaBean 的问题
public class JobBean{
private int[] b;
public int[] getB() {
return b;
}
public void setB(int[] b) {
this.b = b;
}
}
====================
下面的代码如何改用<c:foreach>形式?
====================
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*, com.infoearth.*"
errorPage="" %>
<jsp:useBean id="jobInfo" class="com.infoearth.JobBean" scope="request">
<jsp:setProperty name="jobInfo" property="*"/>
</jsp:useBean>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
hello
<%
int[] temp=jobInfo.getB();
for(int i=0;i<temp.length;i++){
out.print(i+"---"+temp[i]+"<br>");
}
%>
</body>
</html>