<%@ page contentType="text/html" %> <%@ page import="java.util.*" %> Request Counter <%! int counter; public void init() throws ServletException { counter = 0; } %> <% ++counter; %> You are visitor number <%= counter %>. The time now is <%= new Date() %>.
<% if( Math.random() < 0.5) { %>

Have a nice day!

<% } else { %>

Have a lousy day!

<% } %>