1

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

Khushbu Joshi
  • 63
  • 2
  • 8
  • Please don't say "XHTML" when you actually mean "Facelets". While Facelets uses XHTML, XHTML is not per definition Facelets. You'll only get confusing answers. I've edited the title and tags. – BalusC May 30 '12 at 14:32
  • ya.. How to include jsp page in facelet? – Khushbu Joshi May 31 '12 at 08:16

2 Answers2

2

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" />
Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

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.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335