*
The moose likes Struts and the fly likes TILES - >>> floor or ceiling? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "TILES - >>> floor or ceiling?" Watch "TILES - >>> floor or ceiling?" New topic
Author

TILES - >>> floor or ceiling?

Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

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!


A good workman is known by his tools.
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
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

Joined: Oct 06, 2002
Posts: 303
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

Joined: Feb 05, 2003
Posts: 4727

Are tiles considered a form of the Composite View design pattern?
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
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

Joined: Feb 05, 2003
Posts: 4727

Darryl, that article is great! Thanks!
Anyone have more on Tiles?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
http://www.javaranch.com/newsletter/Nov2002/newsletternov2002.jsp#Tiles


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
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.


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
k Oyedeji
Ranch Hand

Joined: Jul 07, 2002
Posts: 96
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TILES - >>> floor or ceiling?
 
Similar Threads
tiles definition as ActionForward
tiles with java script
Struts1 - Create Action and Form for a JSP used in Tiles
Struts-Tiles problem
HTML pages inheritence ?