Khushbu Joshi
Khushbu Joshi

Reputation: 63

How to include a JSP file in a Facelets file?

How can I include a .jsp file into a facelet?

Upvotes: 1

Views: 1053

Answers (2)

BalusC
BalusC

Reputation: 1108557

This is by default not supported. You need to create a custom component for this. You can find complete examples in this blog and this answer. The OmniFaces component library has a reuseable <o:resourceInclude> component for this.

<html ... xmlns:o="http://omnifaces.org/ui">
...
<o:resourceInclude path="/foo.jsp" />

Upvotes: 2

Quentin
Quentin

Reputation: 943108

The only include mechanisms built into XHTML are frames and Xinclude (which I suspect has little support among clients).

Generally speaking, if you want to do includes and your platform supports JSP, then you would process the requested page as JSP and use that to perform the include.

Upvotes: 0

Related Questions