java 的jsp不能request.getParameter("alist");
这里alist是一个复杂的 List<Record>对象
Sep 27, 2009 4:56:37 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 534 in the jsp file: /Input.jsp
Cannot cast from String to List<Record>
531: //String strSql=(String)session.getAttribute(Constants.SQLSTMT_KEY);
532:
533:
534: List<Record> alist=(List<Record>)request.getParameter("alist");
我在action里是这样定义的 request.setAttribute("alist", alist);如何修改?
这里alist是一个复杂的 List<Record>对象
Sep 27, 2009 4:56:37 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 534 in the jsp file: /Input.jsp
Cannot cast from String to List<Record>
531: //String strSql=(String)session.getAttribute(Constants.SQLSTMT_KEY);
532:
533:
534: List<Record> alist=(List<Record>)request.getParameter("alist");
我在action里是这样定义的 request.setAttribute("alist", alist);如何修改?
List <Record> alist=(List <Record>)request.getAttribute("alist");
getAttribute和setAttribute才是合法夫妻
(老紫竹)
request.getParameter("alist") 是从配置文件web.xml中读取参数的。