tagfile.tag

来自「jsp 应用开发技术光盘 是《jsp应用开发技术》这本书的源代码」· TAG 代码 · 共 20 行

TAG
20
字号
<%@ tag pageEncoding="GB2312" %>

<%@ tag import="java.util.Date,java.text.DateFormat" %>
<%@ variable name-given="fullDate" %>
<%@ variable name-given="longDate" %>
<%@ variable name-given="mediumDate" %>
<%@ variable name-given="shortDate" %>
<%
  Date now = new Date(System.currentTimeMillis());
  DateFormat fullFormat = DateFormat.getDateInstance(DateFormat.FULL);
  DateFormat longFormat = DateFormat.getDateInstance(DateFormat.LONG);
  DateFormat mediumFormat = DateFormat.getDateInstance(DateFormat.MEDIUM); 
  DateFormat shortFormat = DateFormat.getDateInstance(DateFormat.SHORT);
  jspContext.setAttribute("fullDate", fullFormat.format(now));
  jspContext.setAttribute("longDate", longFormat.format(now));
  jspContext.setAttribute("mediumDate", mediumFormat.format(now));
  jspContext.setAttribute("shortDate", shortFormat.format(now));
%>
<jsp:doBody/>

⌨️ 快捷键说明

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