站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题一个应用bean的问题

一个应用bean的问题

摘要: 一个应用bean的问题


本人做了一个JSP程序。想运用自己写的bean,但是运行后报错,请问到底错在哪里.程序如下:
<%
ArrayList p=(ArrayList)request.getAttribute("list"); //list为我传递过来的参数,是arrylist类型
for (int i=1;i {
out.print("");
out.print("
"); //此段内容就是生成bean的对象。请问是否用的正确
out.print("<tr>");
pro=p.get(i);
out.println("<td>选择</td>");
out.println("<td>"+pro.getProductID()+"</td>");
out.println("<td>"+pro.getProductName()+"</td>");
out.println("<td>"+pro.getPrice()+"</td>");
out.println("<td>"+pro.getDescription()+"</td>");
out.println("<td>操作</td>");
out.println("</tr>");
}
%>

出错如下:
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 35 in the jsp file: /product_list.jsp
Generated servlet error:
D:/Tomcat 5.0/work/Catalina/localhost/WEBText/org/apache/jsp/product_005flist_jsp.java:90: ?????
??? ?? pro
??? ? org.apache.jsp.product_005flist_jsp
pro=p.get(i);
^


在线等.谢谢大家!


<%@ page import="你的类的包.你的类" %>

你在最上面导入你的类了吗?


你的pro没有定义啦


输入出应该是输入生成Html后面的东西,而不是Java的东西,要不然又要编译一次
ProductDemo pre=(ProductDemo)p.get(i);这样子啦,把那句打打印
out.print("");
out.print("
");


这几句给去了


不知道你是不是真的在线等


ding


怎么不结贴呀?


↑返回目录
前一篇: 如何让关键字(就是刚才在text里输入的值)变成其他的颜色呢?
后一篇: 调用播放器问题