日期:2014-05-20  浏览次数:20567 次

jsp页面传值出现错误,不知如何解决.(急)
我在两个JSP页面之间传递参数时,用了session隐藏对象,两个JSP页面的名字分别为prg.jsp和prg.update.jsp,由于某种原因,我session传的对象是List类的对象,
我在JSP页面前面加了 <%@   page   session= "true "%> ,其部分代码如下:
prgInfo   Info   =   new   prgInfo();
Info.setPrg_num(rs.getString(1));
Info.setPrg_name(rs.getString(3));
Info.setPrg_man(rs.getString(5));
Info.setPrg_dep(rs.getInt(2));
Info.setPrg_st_date(rs.getDate(4));
index++;
list.add(Info);
session.setAttribute( "LIST ",list);
上为prg.jsp页面内的代码.

prgInfo   Info   =   new   prgInfo();
  List   list   =   (List)   session.getAttribute( "LIST ");
                 
  System.out.println(Integer.parseInt(request.getParameter( "INDEX ")));
  int   index   =   Integer.parseInt(request.getParameter( "INDEX "));
  boolean   count   =   list.isEmpty();
                  System.out.println(list.size()+ "   "+index);
  prgInfo   Info   =   (prgInfo)   list.get(index);
 
 
上为prg_update.jsp页面内的代码.

prgInfo是我自己定义的一个存储信息的基类.
prg.jsp转到prg_update.jsp页面是通过一个超链接进行跳转的.

问题是:每次运行到list的接口函数时就会出现错误,prg_update.jsp   页面无法正常显示.
盼高手指点.   本人将不胜感激...



------解决方案--------------------
List 是接口
不知道LZ用多态了吗?
------解决方案--------------------
prg_update.jsp页面上有错误,估计是你页面中的脚本标签中的java代码写错,仔细看看错误提示信息吧,这种问题应该不难的!
------解决方案--------------------
prg_update.jsp 页面的代码全贴上来