Apache Tiles as a structure, but without xml configuration

The Apache Tiles frame is gorgeous. But one thing that I hate is the large xml configuration file, which I need to support, even if it is partitioned, I just hate putting software and presentation information inside the configuration files.

I just do not understand? How do struts / tiles authors achieve this obsessive tendency to place so much presentation logic inside configuration files?

I am looking for a structure like Tiles, but without a bloody XML configuration. Anyone can help with listing layouts based on a Composite View model that competes with Tiles.

+4
source share
5 answers

SiteMesh SiteMash is a similar system for page templates, but can be done without xml. This is especially nice if you have one or two main templates that you constantly use, you do not need to create an XML record for each of them. This is currently the default template system in Grails. Sitemesh 3 has some nice additions, but at the time of this writing, it’s stuck in beta with almost zero documentation. It uses a decorator pattern, as seen in all tile comparisons against sitemesh.


Alternatively, if you are willing to give up jsp, you can give JSF 2.0, which has very impressive template capabilities without the need for xml. This, along with the server-side code model of JSF, will certainly help reduce duplicate code. (As a bonus, the Primefaces component library for JSF 2.0 is one of the most impressive component / widget sets.)

+1
source

Did you consider Apache Wicket ?

With proper markup / logical separation, a POJO data model, and highlighting the lack of XML , Apache Wicket simplifies and simplifies web application development. Change the template, sophisticated debugging and fragile code for powerful, reusable components written in simple Java and HTML.

0
source

Apache Tiles can be configured without using XML .

0
source

The layout tags provided by the stripes are excellent. It does not require any configuration and is easy to understand and start using. They are so large to such an extent that I think they should be pulled out of strips and maintained as a separate project in their own github project space.

0
source

You can see an example of Tiles with Java configuration (without XML) in this publication .

The idea is to implement DefinitionsFactory using TilesDefinitionsConfig and call tilesConfigurer.setDefinitionsFactoryClass(TilesDefinitionsConfig.class); . Your new configuration contains layout definitions.

0
source

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


All Articles