I've been neglecting my blog, but just a quick note to mention that my latest
talk at JavaOne, DSLs with Groovy, is posted up on Slideshare.
The talk's designed for someone with no significant Groovy experience (unlike
most Groovy DSL talks), so if it's interesting to you, check it out.
I'm hoping (but not promising) to turn the talk into a series of Blog entries
in the coming weeks.
So if you want, just wait, and I'll send you explanations in more digestible
bits and pieces in the coming weeks.
(As usual, this entry is cross posted to my main blog site.)
... (more)
Now that we've gone over some Groovy basics, it's time to switch back to
writing in the Java language, and talk about how to run Groovy programs
inside your Java programs. Like most general purpose programming languages,
there's more than one way to do things in Groovy, and that's never more true
when it comes to executing Scripts - I once counted 7 ways to use the String
"System.exit(0)" to shut down the VM, and I'm quite sure that I missed a few.
For this example, we'll use the method I consider to be the best and most
extensible, which uses the class GroovyShell.
Before we ... (more)
Before I start talking about using Groovy's capabilities to create a DSL
(mostly in Java), let's take a few minutes to go over what Groovy is.
Groovy is a general purpose scripting language which runs on the JVM, and can
largely be viewed as a superset of Java. Take the following program:
public class Hello {
String name; public void sayHello() { System.out.println("Hello
"+getName()+"!"); } public void setName(String name) { this.name = name; }
public String getName() { return name; } public static void main(String[]
args) { Hello hello = new Hello(); hello.setName("world"); hel... (more)
Unlike most of my blog posts, where I try to describe the easiest possible
way to do things, in this posting, I'll instead go over a Java-based custom
JSF component that responds to the Ajax tag. The reason being that there
simply aren't any examples out there of how to do this, and at least two
people have expressed interest in finding exactly out how this is done. I'd
advise anyone considering doing this to make really sure that you can't do
the same thing in a Composite Component (you usually can), but sometimes, a
Java-based custom JSF component is going to be required.
We'r... (more)
In a recent blog, commenters took me to task for a perceived IE 6 memory
leak. It wasn't actually there (they were wrong), but in attempting to prove
myself right, I found a couple of memory leaks under IE in JSF's Ajax
support. Since I just spent a week learning how all this functioned, I
thought I'd set it down so that others could learn from my efforts.
Now, none of the information that I'll present here is new - it's been
discussed among Ajax programmers for at least the last 4 years. If you're a
web guru, it's likely that you're not going to learn anything new here
(thought ... (more)