comment.jsp

来自「提供 精通Java Web动态图表编程 一书的源代码, 大家赶快下载呀」· JSP 代码 · 共 53 行

JSP
53
字号
<!--
	Fig. 6.02_01: comments.jsp
	功能: JSP注释语法示例
-->
<%@ page language="java"  contentType="text/html;charset=GB2312"%>
<HTML>
<HEAD>
<TITLE> JSP注释语法示例 </TITLE>
</HEAD>

<BODY>
<%-- 本注释将不会在客户端出现 --%>

<!-- 本注释的生成时间: <%=(new java.util.Date()).toLocaleString() %> -->
<h1>
<%
// 获得系统的当前时间
int time = (new java.util.Date()).getHours();

/*
根据时间来输出不同的问候语。
12点前,输出: 上午好;
12点到18点: 下午好;
18点后,输出: 晚上好.
 */

if (time <= 12)
  out.print("上午好!");
else if (time >= 13 && time <= 18)
		out.print("下午好!");
	 else
		out.print("晚上好!");
%>
</h1>
</BODY>
</HTML>

<%
/**************************************************************************
 * (C) Copyright 2004-2005 by Jingkui Zhong(钟京馗) and Huan Tang(唐桓).  *
 * All Rights Reserved.                                                   *
 *                                                                        *
 * DISCLAIMER: The authors of this code have used their                   *
 * best efforts in preparing the code. These efforts include the          *
 * development, research, and testing of the theories and programs        *
 * to determine their effectiveness. The authors and publisher make       *
 * no warranty of any kind, expressed or implied, with regard to these    *
 * programs or to the documentation contained in these codes. The authors *
 * shall not be liable in any event for incidental or consequential       *
 * damages in connection with, or arising out of, the furnishing,         *
 * performance, or use of these programs.                                 *
 **************************************************************************/
 %>

⌨️ 快捷键说明

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