How can I include a .jsp
file into a facelet?
Asked
Active
Viewed 1,046 times
1
-
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 Answers
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" />
-
thank you so much. I am done with it after 2 days with omnifaces. – Khushbu Joshi May 31 '12 at 09:43
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
-
I've never used JSP, but [it doesn't look complicated](https://www.google.co.uk/search?sugexp=chrome,mod=8&sourceid=chrome&ie=UTF-8&q=jsp+include). – Quentin May 30 '12 at 10:42
-