大牛来帮帮忙 看下异常
先上异常:
下面贴代码 报错的那一行我写注释标记了
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=gbk"
pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>在线短信平台</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK
rel=stylesheet type=text/css href="listMsg_files/sms.css">
<SCRIPT>
function delMsg(id){
confirm("是否确定删除?");
}
</SCRIPT>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY>
<DIV id=main>
<DIV class=mainbox>
<DIV class="title myMessage png"></DIV>
<DIV class=menu><SPAN>当前用户<A
href="listMsg.htm">${user.uname }</A></SPAN> <SPAN><A
href="post.htm">发短消息</A></SPAN> <SPAN><A
href="index.htm">退出</A></SPAN> </DIV>
<DIV class="content messageList">
<%
List msg = (List)request.getAttribute("msg");
System.out.println(msg.size());//这里打印出来是2
%>
<UL>
<c:forEach items="${msg}" var="temp"> <!-- msg经上面的两行测试,是个长度为2的集合 这是报错的一行 -->
<LI class=unReaded><EM>${temp.sendDate }</EM> <EM><A
href="reply.htm">回信</A></EM>
<EM><A href="javascript:delMsg(8)">删除</A></EM>
<P><STRONG><A
href="showMsg.htm">${temp.title }</A></STRONG></P></LI>
</c:forEach>
</UL></DIV></DIV></DIV></BODY></HTML>
[解决办法]
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>改为:
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>试试