if (!session) { session = request.getSession(true) } if (!session.counter) { session.counter = 1 } html.html { head { title 'Groovy Test' } body { h2 'Groovy page called' p("Hello, ${request.remoteHost}: ${session.counter}! ${new Date()}") } }