c标签用法
来源:互联网 发布:java安防软件 编辑:程序博客网 时间:2024/05/18 03:42
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>显示图片</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<c:choose>
<c:when test="${empty photosPaths}">
<h1 style="color: purple;font-size: 50px;">暂时还没有图片</h1>
</c:when>
<c:otherwise>
<c:forEach var="path" items="${photosPaths}" begin="0" end="${size-1}" step="1" varStatus="status">
<%-- <img src="/8JSP${path }" height="200px" width="200px"/> --%>
<c:choose>
<c:when test="${status.first}">
<a href="http://www.baidu.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:when test="${status.last}">
<a href="http://www.google.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:when test="${status.count == 10}">
<a href="http://www.qq.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:when test="${status.count == 21}">
<a href="http://www.kouyang.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:otherwise>
<img src="${path }" height="200px" width="200px"/>
</c:otherwise>
</c:choose>
<%-- <img src="${path }" height="200px" width="200px"/>
---${status.index }---${status.count }---${status.first }---${status.last }<br> --%>
<c:if test="${status.count % 5 == 0 && (status.index+1) % 5 == 0}">
<br>
</c:if>
</c:forEach>
</c:otherwise>
</c:choose>
</body>
</html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>显示图片</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<c:choose>
<c:when test="${empty photosPaths}">
<h1 style="color: purple;font-size: 50px;">暂时还没有图片</h1>
</c:when>
<c:otherwise>
<c:forEach var="path" items="${photosPaths}" begin="0" end="${size-1}" step="1" varStatus="status">
<%-- <img src="/8JSP${path }" height="200px" width="200px"/> --%>
<c:choose>
<c:when test="${status.first}">
<a href="http://www.baidu.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:when test="${status.last}">
<a href="http://www.google.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:when test="${status.count == 10}">
<a href="http://www.qq.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:when test="${status.count == 21}">
<a href="http://www.kouyang.com"><img src="${path }" height="200px" width="200px"/></a>
</c:when>
<c:otherwise>
<img src="${path }" height="200px" width="200px"/>
</c:otherwise>
</c:choose>
<%-- <img src="${path }" height="200px" width="200px"/>
---${status.index }---${status.count }---${status.first }---${status.last }<br> --%>
<c:if test="${status.count % 5 == 0 && (status.index+1) % 5 == 0}">
<br>
</c:if>
</c:forEach>
</c:otherwise>
</c:choose>
</body>
</html>
阅读全文
0 0
- java c标签用法
- C标签的用法
- c:if标签用法
- JSTL C标签用法
- c标签chonse用法
- c标签 choose用法
- c 标签简单用法
- <c:url/>标签用法
- c标签用法
- JSTL C标签的 foreach 标签 用法
- JSTL标签用法if else c标签
- jstl的c 标签用法
- c:if标签的用法
- JSTL中C标签用法
- <c:forEach>标签的用法
- C标签的用法详解
- c标签与choose标签在select标签中的用法
- struts1中的c标签的用法简介
- 十几款Discuz精品采集插件免费下载,总有一款适合您!
- JavaScript入门(二)
- 找bug记(2)
- EventBus 源码试读(三)
- Java中有关Null的9件事
- c标签用法
- CentOS 7 修改MongoDB默认数据存储路径
- 打印的插件
- c语言数据类型和变量
- poj 2456【最大化最小值】
- 数组的使用
- memcached--存储命名--append
- POJ 3250 Bad Hair Day
- Idea 导入module后,代码中jar包找不到引用