Groovy and Tomcat

It’s been a while since my last non-ludum blog post. Since I wrote “iText on the JVM” I’ve been playing with Groovy and Python occasionally. But for the past month and a half, I’ve been getting into Groovy a lot. So much that my next Ludum Dare entry will be written in Groovy/Java.

Up until this blog post I’ve just been experimenting with Groovy, using it to quickly test issues and bugs, but I wanted to do a bit more with it, so I tried using it in Tomcat. I didn’t set up Grails, didn’t want to do that just yet, but I set up Groovy and I’ll document several ways to use Groovy in Tomcat.

Table of contents:

  1. Java HttpServlet calling Groovy
  2. Groovy HttpServlet
  3. Groovy Scripts
  4. Groovy Servlet Pages
  5. Bringing it all together

We’ll start out really simple; use Groovy as an extension to an existing Java servlet and work our way to using scripts in combination with .gsp’s.

Stay tuned,