aspose file tools*
The moose likes JSF and the fly likes Include JSP/JSF pages into other JSP/JSF pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Include JSP/JSF pages into other JSP/JSF pages" Watch "Include JSP/JSF pages into other JSP/JSF pages" New topic
Author

Include JSP/JSF pages into other JSP/JSF pages

David Brossard
Ranch Hand

Joined: Jun 03, 2004
Posts: 109
Hi all,

I am currently working on an icefaces-based web app and I would like to achieve the following:

I have page A which includes pages B, C, and D as the contents of panel tabs (ice:panelTab). To do so I use the ui:include element where ui points to the JSF Facelets namespace.

Page A starts with the usual following code:



I also want pages B through D to be standalone. In other words, I also want pages B through D to start with the same code snippet as aforementioned. However if I include that into A then I get 2 JSP roots and redefined namespaces. In the end it works fine nonetheless but it is extremely poor practice to do so.

My question is therefore whether there is a smart way to include files and remove the root and/or surperfluous elements & definitions.

Cheers,
David.


No matter what they say in Ohio, we're still first in flight!
sri raman
Greenhorn

Joined: Dec 03, 2009
Posts: 6
use <jsp:include> directive to add jsf/jsp pages.

If including JSF pages through the directive then the page being included should have contents nested inside <f:subview>
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

When you use Facelets to include, each included item does have to be a properly-formed XML file, complete with whatever namespaces are referenced in that file. However what JSF assembles isn't going to include all these details. It uses them as part of the initial XML compilation process and discards them thereafter, when they're of no further use. If you read the JSF docs, you'll notice that Facelets ignores stuff outside the ui:component elements, for example.

You're probably worrying about a problem you don't actually have.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Include JSP/JSF pages into other JSP/JSF pages