to the main page about the tutorial  INTERACTIVE WEB SERVICES WITH JAVA back up next

JSP Pages

JSP:


Another Hello-World example:
<% response.addDateHeader("Expires", 0); %>
<html><head><title>JSP</title></head>
<body><h1>Hello World!</h1>
<%! private int hits = 0; %>
You are visitor number <% synchronized(this) { out.println(++hits); } %>
since the last time the service was restarted.
<p>
This page was last updated: <%= new java.util.Date().toLocaleString() %>
</body></html>

Note that only an expert Java programmer could write this:

Inserting code in XML templates:

Alternative XML syntax:

Pre-declared variables:

Directives:

back COPYRIGHT © 2002-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next