Tile in struts project - better than freemarker?

I want to use the template engine in a struts application and would like to know if it is possible to use TILES instead of FREEMARKER or VELOCITY.

+4
source share
3 answers

I used tiles earlier in the project. This was good for templates, however it cannot be compared with speed or freemarker: with Tiles you use regular JSPs and are limited to the JSP tags you received.

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

Hello ${name}

What you cannot do in simple JSPs. [updated due to comment: JSP 2.0 includes EL, so you can do such things. However, I think Velocity or Freemarker are more effective in terms of what you can do with it.]

If you have a layout with many different components (such as a title, sidebar, etc.) and you want to define different patterns, tiles are not a bad choice. (Although be warned - this could be quite a lot of XML!)

But if you need something more "advanced" than just JSP, Velocity or Freemarker could go.

+4
source

I use tiles and speed.

Tiles are great for splitting a page in components and re-marking between screens, while speed is a great template language like smarty in php world.

I recommend not choosing between plates and speed, but using both instead. They complement each other perfectly.

+2
source

Or you can use Stripes. MUCH easier than tiles!

+1
source

Source: https://habr.com/ru/post/1277558/


All Articles