I am trying to create a composite component in JSF and I want the file type as .jspf instead of .xhtml and all the examples I came across online are XHTML. I was just curious whether we can write composite component using JSP or not?
I am trying to create a composite component in JSF and I want the
Share
No, that’s not possible. A composite component is specific to the Facelets 2.0 view technology (or “XHTML”, as you incorrectly overgenerified it). Facelets is basically the successor of the legacy JSP view technology. JSP is been deprecated as view technology since JSF 2.0.
In JSP, closest what you can get to achieve this is a tag file. See also this answer for a concrete example: JSF 1.2 custom component from jsp:include.
Or better, just migrate to Facelets. It offers so much more templating advantages over JSP.