Eclipse keyboard shortcuts anyone?

I happen to be an IntelliJ fan but seeing many of my collegues use eclipse, I decided to give it a try. The experience was really good. I could add have various unrelated projects open in the same navigation bar and work on a single one in the editor. I typically have a few skunkworks sandbox type projects which I work on while commuting (in BART) and I want them readily available. The other thing I really love about Eclipse is the startup time. I load up quite a huge chunk for the WebLogic code but I dont want all the code loaded as soon as a I startup. Eclipse really does this right and Intellij (atleast 5.1) needs improvement here. So far so good.
» Read more…


A while back in 2003, I spent some time and wrote a GZIPFilter which worked with WebLogic Server. It was a simple, efficient implementation which I then published on which can be found here
After getting a lot of feedback from customers, I made a few changes which were incorporated into the source back then. Many customers have asked me for the latest version but I haven’t had time to enhance it further. So finally i’ve decided to post the sources here on my site so users can download and use it anyway they wish. I’d be interested to know your experiences with it though.

Update: I’ve just uploaded the sources and the binary version of the GzipFilter.

Update 2: Peter Laird informed me that it would serve others better if I included the license and complying with that request, here is the latest source. No major changes, just some cleanup and the Apache 2.0 License addition. Peter, do keep me informed how it goes and thanks for letting me know about the license.

Old Comments

Rife: reloading impls

Rife is web framework which does more than your usual framework. After reading a little about Rife around the web, I decided to test drive it. The amazing thing I’ve found is the way it re-compiles your java files even at runtime so the build cycle is eliminated. Just modify a few files and test it out!. Here’s my check list for dev time reloading

  • Can refresh xml files which are used to configure the environment – Yes
  • Can it refresh resources/templates – Yes
  • Lastly Java files
    • Elements / Java classes responsible for the template population – Yes
    • Model Java files; POJOs representing the model – No (I wasn’t able to have these compiled automatically. Its possible that I missed some option or did not have the java files in the correct location. It looks like rife only reloads Element java files)

Looks pretty neat IMO. I’ll blog a bit more about Rife as and when I try it out.

Another life on the web

It so turns out that I lost my old domain so I decided it was time to give myself another shot at life on the web. I did blog a bit at blogspot but I decided its best to blog on my own domain about simply everything from java to the state of the roses in my backyard. Stay tuned for some interesting and fun opinions and rants on everything in my world – nagiworld.

JSE 6 Mustang

After ages we finally have a solution for path length > 255 on Windows. This is pure joy for all serious users of java on windows. Its such a legacy that we started coding around it.. catching this exception and detecting “ooh rats! the path length is too long…, go another route…”

More details here

Feature: does not support long paths on Windows.
Bug ID: 4403166
Status: Delivered in b19
Description: Another longtime bugaboo for many developers, the issue with paths with more than 255 characters on the Microsoft Windows operating system has finally been resolved.

I’m really glad to see this fixed!


All I wanted was to write a useful document on how to use AppGen. Since I had to publish this on to my website at, it had to be html. Now I really am not big with WYSIWYG-editors so I was looking around for a very clean and easy to use html generator which just let me worry about the content rather than the presentation. After a little searching, I found TML which does pretty much everything that I need and in a clean way.

You just have to write your *.tml files in wiki like syntax and run the tml tool i.e. org.antlr.tml.Tool , which has the ability to generate either Lout or HTML. I was just interested in the html part and it works pretty well. Infact the entire antlr and stringtemplate site is based on TML which is pretty neat.

Two small things :

  • If you are writing your *.tml files on Windows then you have to convert the ‘\r\n’ s to ‘\n’ before you pass it on to the TML tool. (Small little quirk) You can rewrite your to look like

cat $1 | tr ‘\r\n’ ‘\n’ | java org.antlr.tml.Tool > $2

  • Each line in the <pre> comments gets an extra newline on Windows, so if I have

output foo
output bar

I get:


output foo

output bar

I haven’t been able to figure out a workaround for this. But since the source code is posted on the site, it should’nt be hard to find and fix this.

Other than that TML is just great for my needs. Finally the search for an easy mark up language is successful. You can check out the file generated at to see how the output html looks like.


Finally, I’ve uploaded an initial cut at appgen. The current version is 0.1 and links and documentation can be found at (Dead Link. Lost the code w/ the domain. In case you’re interested let me know and I can cook up some code over a weekend)
The initial release can be used to generate webapp artifacts namely

  • Filters
  • Servlets
  • Listeners
  • web.xml and weblogic.xml descriptors
  • build.xml

It extensively uses StringTemplate for all the code generation. In addition to all the above features , it can also generate empty implementations for any arbitrary java interface in its classpath. I haven’t exposed that feature yet but intend to do it in a future release.



No, I’m not apologizing for not blogging for so long. Infact after looking at my long history of blogging, I decided to update the description on my blog to add “Very occasional blogger” :-) Its exactly a year since I last blogged and by some divine call I decided it was time to write another short note this year. I hope my next blog is atleast on 8th Jan 2007.
Happy New year

Code generation using StringTemplate

I’ve been using StringTemplate ( for some cool code generation for some time and its ease has really impressed me. I first used it to generate some templates to send email and got hooked on. The simplicity is just awesome. After reading some codegen articles by Terence listed here, I decided to use it to generate java files.

Update: Here is a link one should read to understand code generation with StringTemplate.

What I like about StringTemplate:

  • Strict MVC which is very important IMO. I’ve fallen into traps using other engines where the model can be modified from within the view. As soon as I wanted to add a new view, I was totally lost. I had to go into the old view and find all places where I set some magic value into the model. I like StringTemplate’s policy of just disallowing it instead of giving you an option :-)
  • Flexibility of using various delimiters such as ‘<' or '$' is nice.
  • StringTemplateGroups: I find this very helpful since its very natural to the way one generates code. Group all the templates belonging to a certain action into a group (now doesnt that make sense)
  • Pretty printing is turned on by default. Now all the new lines are exactly where you put them in your template.

(There as many other features which I haven’t yet used but I’ll update on as I do)

Lately I’ve been using it to generate a template for my entire app. I call it appgen (short for app generator) which takes a few options and spits out neatly intended java code such as filters, servlets, listeners and the standard web.xml and weblogic.xml descriptors in any given directory.
Before I wrote this tool, I have some qwerty little script which copied empty war files into a directory. I’d call this tool and then modify all the classnames/ xml descriptors to suit my needs and then fire up my deployer to deploy this war to the server. The tool now lets me specify a set of properties and point it to a dir and I get an entire war all done up. More on appgen soon…

Article on WebLogic JSP Container

My article on avoiding unnecessary recompilation of JSP’s in WebLogic has just been published on It describes the entire stale checking mechanism used by the WebLogic compiler and I hope it helps people in taking the right steps to prevent recompilation and also provides a little insight into the container.