Created
May 24, 2014 11:44
-
-
Save renatoathaydes/cf7ae6174f6718bc13ee to your computer and use it in GitHub Desktop.
A groovlet that logs access and serves a simple HTML page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!session) { | |
session = request.getSession(true); | |
} | |
if (!session.counter) { | |
session.counter = 1 | |
} | |
html.html { | |
head { | |
title 'Simple Groovlet' | |
} | |
body { | |
h1 'Welcome to my Groovlet' | |
p "The current time at this server is ${new Date()}" | |
p "The session counter is now at ${sesson.counter}" | |
br() | |
p "System properties:" | |
ul { | |
for ( prop in System.properties.keySet()) { | |
li "$prop: ${System.getProperty(prop)}" | |
} | |
} | |
} | |
} | |
session.counter += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment