⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simple.jsp

📁 jsp开发详解第15章全部代码
💻 JSP
字号:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>

<jsp:useBean id="now" class="java.util.Date" />
<fmt:setLocale value="zh-cn" />

<%@ page import="java.util.*"%>
<html>
<head>
  <title>JSTL: 这里是一个简单的JSTL应用</title>
</head>
<body bgcolor="#FFFFFF">

<h3>这里是一个简单的JSTL应用</h3>
<%
   Collection customers=new ArrayList();
   customers.add(new String("guest1"));
   customers.add(new String("guest2"));
   customers.add(new String("guest3"));
   //设置customers为request的属性。
   request.setAttribute("customers",customers);
%>
<h4>Customers in the request:</h4>
<c:set var="customer" scope="session" value="${requestScope.customers}"/>
<c:forEach var="customer" items="${customers}">
      <c:out value="${customer}"/><br>
  </c:forEach>
  
  <br>
  现在的时间是:
 <br>
  <fmt:timeZone value="GMT">
   <fmt:formatDate value="${now}" type="both" dateStyle="full"
                   timeStyle="full"/>
  </fmt:timeZone>


</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -