myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikkomarc <>
Subject How to use jstl import to import a page fragment from a different application?
Date Mon, 05 Nov 2007 18:33:46 GMT


My jsp page uses myfaces/tomahawk.  I'd like to import a page header and a
page footer to my jsp page.  The page header and footer also use
myfaces/tomahawk.  To research this, I downloaded the
myfaces-examples-simple.  Then, I copied that application to create a new
HelloWorldWeb application.  In my HelloWorldWeb application, I successfully
included the page header by referencing page_header.jsp that is part of the
same application.  Including it through jsp:include and c:import both were

       <f:facet name="header">
            <f:subview id="header">
                <jsp:include  page="/inc/page_header.jsp" />

       <f:facet name="header">
            <f:subview id="header">
                <c:import  context="/HelloWorldWeb"
url="/inc/page_header.jsp" />

I then, tried to import the same page_header.jsp page from a different web
application as shown below:

       <f:facet name="header">
            <f:subview id="header">
                <c:import  context="/myfaces-examples-simple"
url="/inc/page_header.jsp" />

When I try to access that page, I get a FacesContext error:

"Faces context not found. getResponseWriter will fail. Check if the
FacesServlet has been initialized at all in your web.xml configuration
fileand if you are accessing your jsf-pages through the correct mapping.
E.g.: if your FacesServlet is mapped to  *.jsf (with the -element), you need
to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp',
you'd get this error-message."

How can I import a page header from a different application and contains
myfaces code to my jsp page?

Thank  you,


View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message