请问如何在JSTL中使用bean的方法
有一个数据库操作bean,我想用它方法来得到一个二维的字符串数组,bean本身没有问题,在scriplet里通过测试,但如果写在JSTL里就会报错,换了好几种写法都不行,我怀疑是不是在JSTL中不能使用bean的方法.哪位有知道的麻烦指点一下.JSP代码如下:
<%@ page contentType="text/html;charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="DbSource.jsp"%> //包含bean的页面,bean的名字为db
<%@ page errorPage="errorpage.jsp"%>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<title>数据库测试</title>
</head>
<body>
<%
String[][] szResultSet = db.getResultSet("select * from student");
out.println("<table border='1' width='300'>");
for(int i=0;i<szResultSet.length;i++)
{
out.print("<tr>");
for(int j=0;j<szResultSet[i].length;j++)
{
out.print("<td>" + szResultSet[i][j]+ "</td>");
}
out.println("</tr>");
}
out.print("</table>");
%> //以上已通过测试
<c:out value="<form border='1' width='300'>" escapeXml="false"/>
<c:forEach items="${db.getResultSet('select * from student')}" var="data1">//这行报错
<c:out value="<tr>" escapeXml="false"/>
<c:forEach items="${data1}" var="data">
<c:out value="<td>" escapeXml="false"/>
<c:out value="${data}"/>
<c:out value="</td>" escapeXml="false"/>
</c:forEach>
<c:out value="</tr>" escapeXml="false"/>
</c:forEach>
<c:out value="</form>" escapeXml="false"/>
</body>
</html>
错误信息:
org.apache.jasper.JasperException: /Test.jsp(30,3) The function getResultSet must be used with a prefix when a default namespace is not specified