Hi, I noticed in my Spring book that Spring supports Tiles. What do you guys suggest using to reduce the duplication of JSP code. Do most people use Tiles, JSP includes, what?
Yes Tiles is a layout engine that allows you to create re-usable areas of screens. This is definitely something I use in my applications. An alternative to Tiles is Sitemesh. The first uses composition while the latter uses decoration. They are two different approaches for solving the same problem. Spring will work with either, although it seems most books, blogs etc seem to prefer Tiles. There are pros and cons to each and a google search will result in quite a few discussions favoring one or the other. I think which one you choose depends on preference, familiarity, or project requirements. I would definitely strongly encourage the use of one or the other though,
We used Tiles with Struts in 2004 on a project, but then I got away from Web applications and was working with Oracle Service Bus. I'm now back to Web applications and didn't know what was used these days. Thank you for your reply, I definitely see the benefits of this technology and am a fan of them.
I am working on a project to reduce the massive code duplication which exists in our servlets-and-JSP (not Spring) web application. I'm using Tiles to do that and it works well to get rid of the duplicate code which is caused by all of the pages having similar headers and footers. But templates only go so far in getting rid of duplication, you'll find there are other forms of duplication which can't be templated.