You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rafael Nami <ra...@gmail.com> on 2005/10/10 20:13:24 UTC
includes inside jsf
I have a header.jsp and a footer.jsp, that have to be in a main.jsp.
If I add a <body> tag in the header.jsp and closes it with a </body> in the
footer.jsp, and include the header.jsp before the f:view, and finally
include the footer.jsp after the </f:view>, it throws a exception.
What's the correct approach? I do the includes inside a <f:subview> on the
main.jsp? PS - I don't want to use Tiles or Sitemesh, because it's a very
tiny project.
Thanks in advance
Rafael Mauricio Nami
Re: includes inside jsf
Posted by Mike Kienenberger <mk...@gmail.com>.
I think you can do this like this (it worked for me before I switched
from jsp to facelets):
On your main page:
<jsp:include page="/pages/header.jsp"/>
On header.jsp:
========================
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:subview>
....
</f:subview>
========================
I left the body tags on the main page.
-Mike
On 10/10/05, Rafael Nami <ra...@gmail.com> wrote:
> I have a header.jsp and a footer.jsp, that have to be in a main.jsp.
> If I add a <body> tag in the header.jsp and closes it with a </body> in the
> footer.jsp, and include the header.jsp before the f:view, and finally
> include the footer.jsp after the </f:view>, it throws a exception.
> What's the correct approach? I do the includes inside a <f:subview> on the
> main.jsp? PS - I don't want to use Tiles or Sitemesh, because it's a very
> tiny project.
>
> Thanks in advance
>
> Rafael Mauricio Nami