Facelet - nested <ui: insert>

I have several templates that differ from each other with only a few containers. The hardest one contains a superset of all the containers used in all the rest, so as to avoid creating multiple templates that I created the most complex in the following format

<ui:insert name="container1">
 some layout stuff (div and all)
 <ui:insert name="container1Content">
 </ui:insert></ui:insert>

Defining a nested insert for each container and content.

Now in the client template, based on what is needed I turn off the container, which is not needed as

<ui:define name="container1/>

else if the container is needed just define the content as

<ui:define name="container1Content">doSomething</ui:define>

Please let me know if you see any problems with this approach, any potential problem or alternative approach for a similar scenario.

Many thanks.

Maddy

+3
1

Facelets UI - , .

Facelets, , ui-insert, , , (, , ,...

+1

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


All Articles