import java.util.Date
if (session.counter == null) {
session.counter = 1
}
out.println(<<<EOS
<html>
<head>
<title>Groovy Servlet</title>
</head>
<body>
Hello, ${request.remoteHost}: ${session.counter}! ${new Date()}
<br>src
</body>
</html>
EOS)
session.counter = session.counter + 1
So now the pages can look a little more JSP-EL like. As you can see, I’ve exposed the session in the script context and am using the set/getAttribute as the generic setters and getters for the class. This has gotten me thinking about being able to just import the textual part of the page or to have a pair of pages so the template text is in one place and the implementation is in another. For now, this is good enough.
I’ve also gotten rid of my share of bugs since I started submitting code. Maybe you should go and play with it see if you can file some more? There are still some core things left that need to be implemented, I’m looking at some of them now to see what I should work on next. I think the number one thing on my list is regex support.