aspose file tools*
The moose likes Spring and the fly likes Spring and Tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring and Tiles" Watch "Spring and Tiles" New topic
Author

Spring and Tiles

Ray Clark
Ranch Hand

Joined: Aug 16, 2012
Posts: 52
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?

Thanks,
Ray
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1649
    
    7

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,


[How To Ask Questions][Read before you PM me]
Ray Clark
Ranch Hand

Joined: Aug 16, 2012
Posts: 52
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.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1649
    
    7

Yeah, I would say it is Tiles or Sitemesh, with the former appearing to be a little more prevalent. There are some good arguments for both though.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring and Tiles