📄 comment.jsp
字号:
<!--
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -