jsp动态输出后台查询内容

来源:互联网 发布:有关小说的软件 编辑:程序博客网 时间:2024/06/02 13:08
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%String path = request.getContextPath();String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><body><%List list = new ArrayList();String[] arr1 = new String[] { "a", "b", "c", "d", "e" };String[] arr2 = new String[] { "a", "b", "c", "d", "e" };String[] arr3 = new String[] { "a", "b", "c", "d", "e" };String[] arr4 = new String[] { "a", "b", "c", "d", "e" };list.add(arr1);list.add(arr2);list.add(arr3);list.add(arr4);request.setAttribute("list", list);%><table><c:forEach items="${list}" var="subArr"><tr><c:forEach items="${subArr}" var="subArr1" varStatus="status"><!-- 根据自己的需要去输出指定列的数据 --><c:if test="${status.index>1}"><td>${subArr1}</td></c:if></c:forEach></tr></c:forEach></table></body></html>


 

原创粉丝点击