Sitemesh vs jsp-config (<include-prelude>)

Please help clarify:

In web.xml I have

<jsp-config>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <el-ignored>false</el-ignored>
      <page-encoding>utf-8</page-encoding>
      <include-prelude>/jstlTaglibs.jspf</include-prelude>
    </jsp-property-group>
</jsp-config>

Also in decorators.xml I have

<decorator name="footer" page="footer.jsp">
    <pattern>*.action</pattern>
</decorator>

which is used through the sitemesh.xml file. Footer.jsp which says

...
<decorator:body />
<@include .. "footer.jsp"/> 

So, what I collect, both of the above codes in some sense inject some jspf. Please help highlight the differences and benefits of both approaches. And which one is more used in industry?

+3
source share
1 answer

JSP include-prelude is used to enter a jsp snippet at the beginning of each jsp page. This can be used in a clean jsp environment to avoid writing the same code on every page. The code that is entered is executed as jsp.

Sitemesh, , jsp html. sitemesh , html, html, PHP JSP . HTML- .

, , .

+2

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


All Articles