Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TILES - >>> floor or ceiling?

 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jakarta Struts' development team is looking over some problems with memory hogging using tiles. I'm new to tiles and think the concept is long overdue. I hate rewriting html code!
I'm wondering if tiles will really catch on. It seems that Java already has so many APIs and whatnot that people are getting fed up with the complexity.
I know that there are Perlmongers out there that want to see Java on the client side disappear, but what [honestly] are the chances of seeing tiles commonly listed as a requirement job postings in the next few years?
(I'm thinking Struts and tiles together will really make a move within 6 months of the final Struts 1.1 release.)
Also, if anyone knows of a good book or website that covers tiles, please post them!
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following book is a great resource on Tiles:
Husted, Ted, et al. "Struts in Action" (Greenwich, CT: Manning Publications Co., 2003)
ISBN: 1-930110-50-2.
Darryl
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
The new O'Reilly books on Struts has a chapter on Tiles as well. Sorry, I don't have it's title / ISBN here at the moment.
Darryl
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are tiles considered a form of the Composite View design pattern?
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marc,
I did a search and found that Tiles is a form of the Composite View design pattern. A discussion of this very fact can be read here:
http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-designpatterns-p2.html
Cheers,
Darryl
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl, that article is great! Thanks!
Anyone have more on Tiles?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marc Peabody:
Jakarta Struts' development team is looking over some problems with memory hogging using tiles. I'm new to tiles and think the concept is long overdue. I hate rewriting html code!

Me too. So I came up with a way to cheat.

1) Create an action that all it does is forward your user... here's my execute() implementation:

2) Make this action your default action for struts. In your struts config:
<action path="tileForward" type="my.struts.TilesAutoForwardAction" unknown="true">
<forward name="404" path="/404.html" />
<forward name="baseForward" path="/tilesContent.jsp" contextRelative="true" />
</action>
3) Create tilesContent.jsp. All it does is include a tiles definition...

4) Create a 404.html for when pages aren't found
5) configure your tiles-defs.xml definitions as usual.
6) Configure your action servlet to respond to all pages of *.do (you probably did this anyway)
7) Make all forwards/links to pages with *.do as an end. To link to a tile definition, i.e. if you have a tile named "faqs" that extends your base layout definition, link to faqs.do
Personally I would advise setting a second extension (I use *.dhtml) for your action to respond to. That way you can tell the difference between a link to a tiles definition and an action.
Anyway, what this gains you is that you don't have to define 19,786 jsp's that all you do is a tiles:insert for a definition.
 
k Oyedeji
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're still looking for more info
there is a sample chapter from struts in action available online which covers Tiles here:-
http://www.manning.com/husted/chap11.pdf
I do agree with the point you made about complexity. It seems that KISS has been forgotten.
To develop a struts application using all the components you'll probably need knowledge of JSP, servlets, html/javascript/css, SQL, java, your servlet container, Tiles, the validation framework etc....
Looking at struts 1.0, it seemed simple in comparison to 1.1 (based on my reading of the new o'reilly book).
Kola
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic