GDMT
GDMT

Reputation:

tiles in struts project - better than freemarker?

I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.

Upvotes: 4

Views: 1825

Answers (3)

CJones
CJones

Reputation: 11

Or you could use Stripes. MUCH easier than Tiles!

Upvotes: 1

Sergio del Amo
Sergio del Amo

Reputation: 78106

I use tiles and velocity.

Tiles is great for dividing a page in components and reuse markup between screens while velocity is a great template language such smarty in the php world.

I recommend not to choose between tiles and velocity but instead use both. They complement each other really well.

Upvotes: 2

user7094
user7094

Reputation:

I've used tiles before on a project. It was good for templating, however it can't really be compared to velocity or freemarker: with Tiles you use normal JSPs and are limited to the JSP tags youv'e got.

Velocity (and probably Freemarker although I haven't used it before) provide their own tags or expression language, so you can do thinks like:

Hello ${name}

Which you can't do in plain JSPs. [updated due to comment: in JSP 2.0, EL is included so you can do things like that. However, I think Velocity or Freemarker are more powerful in terms of what you can do with it.]

If you've got a layout with lots of different components (i.e. header, sidebar, etc) and you want to define various different templates, tiles isn't a bad choice. (Although be warned - it can be quite a lot of XML!)

But if you need something more "advanced" than plain JSPs Velocity or Freemarker might be the way to go.

Upvotes: 4

Related Questions