使用Facelets布局,在xhtml中使用jstl,但是不解析.不知为什么?
pcenshao
2010-06-26
页面的源代码:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fmt="http://java.sun.com/jstl/fmt"> <!-- 调用template/layout.xhtml模板 --> <ui:composition template="template/layout.xhtml"> <ui:define name="title">查看Message</ui:define> <ui:define name="body"> <table width="665" height="177" border="0"> <c:forEach items="${msgBean.messages}" var="msg"> <tr> <th width="42" height="31" bgcolor="#666699" scope="row"> 标题: </th> <td width="259"> ${msg.title} </td> <td width="53" bgcolor="#666699"> <strong>时间:</strong> </td> <td width="283"> <fmt:formatDate value="${msg.replyTime}" pattern="yyyy-MM-dd HH:mm"/> </td> </tr> <tr> <th height="21" bgcolor="#666699" scope="row"> IP: </th> <td colspan="3"> ${msg.ip} </td> </tr> <tr> <th height="117" bgcolor="#666699" scope="row"> 内容: </th> <td colspan="3"> ${msg.content} </td> </tr> </c:forEach> </table> <font size="2" color="gray"> </font> </ui:define> </ui:composition> </html> 访问该页面,在浏览查看到的源代码: <c:forEach items="[pcenshao.jsf.msgborad.entity.Message@f3770c, pcenshao.jsf.msgborad.entity.Message@9e0c2d, pcenshao.jsf.msgborad.entity.Message@318293, pcenshao.jsf.msgborad.entity.Message@739aa3, pcenshao.jsf.msgborad.entity.Message@1ad6c98, pcenshao.jsf.msgborad.entity.Message@b49b19, pcenshao.jsf.msgborad.entity.Message@132be10, pcenshao.jsf.msgborad.entity.Message@5c2fee, pcenshao.jsf.msgborad.entity.Message@4eb585, pcenshao.jsf.msgborad.entity.Message@16f3619]" var="msg"> <tr> <th width="42" height="31" bgcolor="#666699" scope="row"> 标题: </th> <td width="259"> </td> <td width="53" bgcolor="#666699"> <strong>时间:</strong> </td> <td width="283"> <fmt:formatDate value="" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate> </td> </tr> <tr> <th height="21" bgcolor="#666699" scope="row"> IP: </th> <td colspan="3"> </td> </tr> <tr> <th height="117" bgcolor="#666699" scope="row"> 内容: </th> <td colspan="3"> </td> </tr> </c:forEach> 怎么还有<c:forEach> 为什么会这样??? |