I was building the file structure for a new project today and then moved on to copy jars into a lib directory. One of the jars was velocity.jar. I have used Velocity a couple of times with great success, but I have never made the plunge and used it to replace JSP's. I wish I had used Velocity on my last application. I was using JSTL, which was much better than the Struts taglibs, and built some really hairy dynamic forms with it. You would pass in an object that described the ActionForm and it would create all of the fields needed. I had one JSP that was used for every Create and Update and another that was used for the Read and Delete. CRUD for 10 domain objects were handled by two JSP's. I could probably cut the size of those JSP's in half if I had used Velocity instead.
I spoke with the developer that took my place today, he said he was having trouble figuring out how the JSP's work. He acknowledged that being a rookie developer didn't help, but I am here to say... those are some killer JSP's. The team will probably just create the normal edit and view JSP's for all of the domain objects and get rid of my uber JSP's.
I am pretty sure that JSTL was not the answer to the problem that I had, more than likely I should have used Velocity. There were so many hoops that I had to jump through to get JSTL to play nice and deliver the goods. I kept wishing to be able to call methods from the JSTL and not be stuck with getters, Maps and Lists.
Velocity here I come.
Posted by carl at February 18, 2004 10:26 PM
Comments