<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
<%
Object message = request.getAttribute("message");
if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<center>
<table>
<c:forEach items="${home}" var="item">
<tr>
<td>${item.id}</td><td>${item.baojia}</td><td> <a href="houtai?method=chaxun1&id=${item.id}">${item.dizhi}</a></td>
</tr>
</c:forEach>
</table>
</center>
</body>
</html>
其中home是servlet层传递的参数,类型通常为list型,通过c标签可以实现遍历
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html>
<body><center>
<table class="tb">
<tr>
<td>${f.id}</td>
<td>${f.huxing}</td>
<td>${f.dizhi}</td>
<td>${f.nianfen}</td>
<td>${f.mianji}</td>
<td>${f.baojia}</td>
<td>${f.zhuangtai}</td>
</tr>
</table>
</center>
<br>
</body>
</html>
f同样为servlet层传递的参数,但是类型通常为bean层的某一类
标签:界面,baojia,dizhi,item,jsp,UTF,message,id,模板 From: https://www.cnblogs.com/jiazq/p/17013634.html