%-- This JSP comment will not appear in the
generated html --%>
<%-- This is a JSP directive: --%>
<%@ page import="java.util.*" %>
<%-- These are declarations: --%>
<%!
long loadTime= System.currentTimeMillis();
Date loadDate = new Date();
int hitCount = 0;
%>
<%-- The next several lines are the result of a
JSP expression inserted in the generated html;
the '=' indicates a JSP expression --%>
This page was loaded at <%= loadDate %>
Hello, world! It's <%= new Date() %>
Here's an object: <%= new Object() %>
This page has been up
<%= (System.currentTimeMillis()-loadTime)/1000 %>
seconds
Page has been accessed <%= ++hitCount %>
times since <%= loadDate %>
<%-- A "scriptlet" that writes to the server
console and to the client page.
Note that the ';' is required: --%>
<%
System.out.println("Goodbye");
out.println("Cheerio");
%>