Practically Groovy: Go Server-Side Up, with Groovy
By Andrew Glover2005-05-05
On-the-fly Server-Side Programming with Groovlets and GSPs
The Java platform arguably has made a name for itself as the platform of choice for server-side application development. Servlets have been a strong foothold for server-side Java technology, so much so that myriad frameworks have been built around the Servlets API, including Struts, JavaServer Faces (JSF), and Tapestry, to name a few. As you've probably guessed, Groovy has also built a framework on the shoulders of the Servlets API; however, the aim of this framework is simplicity.
The Groovlet and GroovyServer Pages (GSP) frameworks aim to provide an elegant yet simple platform for building Web applications of minimal complexity. Just as GroovySql shouldn't be your only choice for database development, the Groovlet framework is not a replacement for more feature-rich frameworks like Struts. Groovlets are simply an alternative for developers seeking an easy configuration and quick means to producing working code.
For example, a short time ago, I needed to provide -- quickly -- a stub application for testing the client side of an xml-rpc-like API. It was obvious I could rapidly stub out the required functionality with a servlet, but I would have never considered delving into Struts -- not even for a second. I considered writing the servlet and its associated logic using the base normal-Java Servlet API; but because I needed the functionality ASAP, I chose to knock it out using Groovlets.
As you'll see shortly, the choice was obvious.
Before I get too far into programming with Groovlets, I'd like to quickly review a Groovy feature that will come up in the example code. I first wrote about the def keyword in the original Feeling Groovy article, a few months back.
About this series
The key to incorporating any tool into your development practice is knowing when to use it and when to leave it in the box. Scripting languages can be an extremely powerful addition to your tool kit, but only when applied properly to appropriate scenarios. To that end, Practically Groovy is a series of articles dedicated to exploring the practical uses of Groovy, and teaching you when and how to apply them successfully.
Tutorial pages:
|
First published by IBM DeveloperWorks
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "Practically Groovy: Go Server-Side Up, with Groovy"
You must be logged in to post a comment.
Link to This Tutorial Page!

