Hi,
I am considering using Facelets and JSTL in the same web project.
Are there any issues in integrating these ?
Hi,
I am considering using Facelets and JSTL in the same web project.
Are there any issues in integrating these ?
Hello,
As explained in the Facelets doc here, JSTL can be integrated in Facelets application. However, some components of the JSTL library must be avoided if possible, such as <c:set>
for example.
Note that Facelets also provide some replacements for JSTL tag. Thus, you can replace <c:forEach>
by <ui:repeat>
tag (read more here about these two components).
JSTL is not supported in Facelets. Facelets has however cloned a limited set of "good old" JSTL tags and included in the Facelets library. They are all described here. In other words: you don't need to install JSTL to get those tags to work. You can however also not install it separately. It won't work.
If there's any original JSTL tag which you would like to use, but isn't made available by Facelets, then you'll head in another corner for the solution. The jobs which can be done by the JSTL sql and xml taglibs doesn't belong in the view, but rather in the model/business logic. The JSTL fmt taglib is already covered by JSF's <f:loadBundle>
and the <f:formatXXX>
tags. The JSTL functions taglib can be as good done with custom EL functions. I've posted an example in this answer.
The problem with JSF and the original JSTL library is that they doesn't run in sync as you would expect from the coding. It's more so that JSTL runs the page from top to bottom first and then hands the generated output over to JSF for further processing. This may lead to unexpected results when using for example <c:forEach>
.
clarity would be appreciated. have the jstl tags been "translated"/"converted" to JSF 2.0?
-Thufir