Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Quick 'n Easy SiteMesh Tutorial

SiteMesh is a kick-ass tool. It's much easier to use and configure than Tiles, although I don't know if its as powerful. Tiles has Controllers that you can assign to a definition and it supports easy i18n. I've been using Tiles for over 3 years and I've only used SiteMesh for a few months. However, SiteMesh already seems to suite all my needs. I'm guessing that most people use Tiles over SiteMesh because they haven't given SiteMesh the 10 minute test.

Anyway, back to the point of this post. Rick Reumann has put together a nice tutorial titled Use SiteMesh instead of Tiles.

I think you will quickly see the benefits after going through this brief example. In summary, the main reason I like SiteMesh more than Tiles is that SiteMesh is much easier to configure and use (less typing and easier to understand).

Good stuff - thanks Rick! As part of the WebWork integration into AppFuse, I was planning on using SiteMesh. I'm already using it in Spring Live sample app and it's pretty slick. I haven't had to touch it since I integrate it. Compare this with Tiles where you have to add a new definition (or JSP) everytime you want a new page. If nothing else, I think Tiles needs to learn from SiteMesh and add a Filter that can be used to decorate pages.

Posted in Java at Jun 13 2004, 02:15:50 PM MDT 9 Comments
Comments:

Have you tried out the page:applyDecorator tag? You can create templates for things like how forms look, then wrap the form content in a quick page:applyDecorator to wrap it with a common look and feel, and voila! your page looks the same as the rest of your site with no copy-n-paste... and you can parameterize them. Sitemesh isn't just for wrapping the final page, it can be used in-line to wrap little pieces of content.

Posted by Jason Carreira on June 13, 2004 at 07:05 PM MDT #

I think people don't use SiteMesh instead of Tiles because the documentation sucks. Unfortunately, because of this alot of people fail to try it and see just how easy it actually is. Documentation of it can almost afford to be lacking as it's pretty intuitive once someone gets started. Hopefully tutorials like Rick's will convert more Tiles users.

Posted by Tim Chen on June 13, 2004 at 09:39 PM MDT #

Huh? I disagree... Sitemesh's docs are pretty good (with the exception of the omission of documentation on content blocks), and get you started pretty quickly.

Posted by Jason Carreira on June 13, 2004 at 10:20 PM MDT #

No. Sitemesh docs are pretty good for only the basic case. There is a one page blurb about the more advanced DecoratorMappers but nothing to show how to use them. For some of them you have to poke into the javadocs/source to see what it requires and how to use it.

Posted by Tim Chen on June 14, 2004 at 06:30 AM MDT #

Can proper CSS design eliminate the use of display decorators technologies like Tiles and SiteMesh? I started using Tiles when I needed have a more flexiable layout strategy but I noticed I was still using tables for layout. Once I started learning how to layout web pages with divs and style sheets (and if anyone haven't done this, I strongly suggest you look into it), I was able to eliminate tiles altogether. Maybe my layout requirements were a little more simplified than most but it was just a thought I was having while reading this post. Maybe a CSS based design combined with SiteMesh would be a good combination.

I have seen SiteMesh mentioned in alot of blogs and other websites so it seems there is fairly strong following. It definitely looks like something worth checking out.

Posted by Dave Keller on June 14, 2004 at 06:48 AM MDT #

<em>> Can proper CSS design eliminate the use of display decorators technologies like Tiles and SiteMesh?</em>

CSS can definitely make your pages lightweight and easy to re-design, but it doesn't eliminate the need for templating systems. If you don't use a templating system, you'll have to specify DOCENGINE, <html>, <head> and other elements for each page. With a good templating system, you can just write the contents of that page (i.e. a <form>) and be done with it. Of course, I <em>highly</em> recommend using CSS as much as you can - AppFuse and other projects I've developed have only a few <div>'s in the HTML and everything else is handled by CSS. In fact, Struts-Resume and AppFuse have virtually no structural differences in their respective baseLayout.jsp files - even though their designs are very different.

Posted by Matt Raible on June 14, 2004 at 07:39 AM MDT #

Is it possible to add SiteMesh directory & jar as part of latest appfuse in cvs?

Posted by Greg Jones on June 14, 2004 at 02:56 PM MDT #

Greg - it's easy to add new dependencies to AppFuse. Just create a sitemesh-<em>version</em> directory in the "lib" directory, add entries to lib/lib.properties and then edit build.xml's "package-web" target to include the JAR when you deploy.

Adding it is one thing, re-doing the Tiles implementation with it is another. It'll probably only take a few hours, but I don't have the bandwidth right now. Maybe in July.

Posted by Matt Raible on June 14, 2004 at 03:18 PM MDT #

I known what something dislike me in Tiles :). In first sign SiteMesh is very good ( make site layout KISS). Think I'll replace tiles to SiteMesh in my next project.

Posted by A3T on June 14, 2004 at 10:59 PM MDT #

Post a Comment:
Comments are closed for this entry.