Newbie Alert: How can I include a JSF in a JSF

Sorry for what must be a really stupidly easy question but I have tried every way I can think to get one JSF page to include another JSF page. For instance I want to include a standard site wide header. I am using jspx and have tried
<f:subview id="header">
    <jsp:include page="header.jsf"/>
</f:subview>and
<f:subview id="header">
    <c:import url="header.jspx"/>
</f:subview>and every variation you can imagine (both .jsf and .jspx extentions, with and without a rendered property on the subview, including everything in the included page in f:verbatim and a million other things). My header page is as simple as <?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0"
     xmlns:jsp="http://java.sun.com/JSP/Page"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html">
     <f:view>
          <f:verbatim>
<p>this is a header</p>
          </f:verbatim>
     </f:view>
</jsp:root>All the questions I have found seem to indicate that the above should work but I just get
javax.faces.FacesException: Assertion Failed
     at com.sun.faces.util.Util.doAssert(Util.java:1302)
     at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:241)
     at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1013)
     at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1036)
     at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:749)
     at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
     at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
     at org.apache.jsp.header_005f1_jspx._jspx_meth_f_view_0(header_005f1_jspx.java:77)
     at org.apache.jsp.header_005f1_jspx._jspService(header_005f1_jspx.java:55)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)and various other errors along the same lines.
Can someone please give me some pointers. A working example would be nice :o)
Many Thanks

Many thanks. I still can't seem to get it to work though. I must be missing something really obvious. Could you have a quick look over these pages and tell me if anything is wrong.
The including page (called page.jspx):
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0"
     xmlns:jsp="http://java.sun.com/JSP/Page"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html">
     <jsp:directive.page contentType="text/html"/>
     <f:view>
          <f:loadBundle basename="localization.messages" var="text"/>
          <f:verbatim>
               <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
          </f:verbatim>
          <html xmlns="http://www.w3.org/1999/xhtml">
               <head>
                    <title>Example</title>
               </head>
               <body>
                    <jsp:include page="simple_header.jsf"/>
               </body>
          </html>
     </f:view>
</jsp:root>the included page called simple_header.jspx
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0"
     xmlns:jsp="http://java.sun.com/JSP/Page"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html">
     <f:subview id="header">
          <f:verbatim>
               <p>Bar</p>
          </f:verbatim>
     </f:subview>
</jsp:root>and finally the error message
java.io.IOException: Stream closed
     org.apache.jasper.runtime.BodyContentImpl.ensureOpen(BodyContentImpl.java:576)
     org.apache.jasper.runtime.BodyContentImpl.write(BodyContentImpl.java:140)
     org.apache.jasper.runtime.BodyContentImpl.write(BodyContentImpl.java:157)
     org.apache.jsp.page_jspx._jspx_meth_f_view_0(page_jspx.java:102)
     org.apache.jsp.page_jspx._jspService(page_jspx.java:58)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
     com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
     com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
     com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
     com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
     com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
blah blah blah...

Similar Messages

  • How can I include a jsf page?

    I need to include a jsp page that contains jsf code, I try with:
    <c:import url="faces/include.jsp" var="prova" />
    but the server response:
    javax.servlet.ServletException: Cannot find FacesContext
    There something that is wrong?
    Thank's
    Teo

    I read the document but is not my case.
    My java server faces works well until I put the tag
    <c:import url="./include.jsp" var="jsf" />
    from tag library, ans I don't know why
    Thank's
    Matteo

  • How can I include my business email fonts on the ipad signature?

    How can I include my business email fonts on the ipad signature?

    It's a lot easier with Photo Manager Pro.
    https://itunes.apple.com/sg/app/photo-manager-pro/id393858562?mt=8

  • How can I include different DAQ cards (for notebook and PC) in one applicatio​n?

    I want to build one application, which runs on different computers. On PC a DAQ board PCI-6052E and LabVIEW including application builder are installed and work. My program runs.
    Now I want to build an application, which runs on the notebook without LabVIEW but with the similar DQACard-AI-16XE-50, too.
    How I have to install the DAQCard on the notebook and how can I include the driver?

    Sylke,
    Check the following link which guides you step by step to install the driver and configure the daq board:
    http://www.ni.com/support/install/
    Hope this information is helpful.
    L Aguila
    Applications Engineer
    National Instruments

  • I have a mac book pro, an ipad and an iphone.  i have an icloud account that allows my iPad and imac to sync.  but my mac book only has a connection to 'mobile me'.  how can i include my macbook with my other devices?  help!  thanks

    i have a mac book pro, an ipad and an iphone.  i have an icloud account that allows my iPad and imac to sync.  but my mac book only has a connection to 'mobile me'.  how can i include my macbook with my other devices?  help!  thanks

    You need OSX 10.7.2 or higher in order to access icloud.  The mobile me account is now defunct (it closed down more than a year ago).

  • How can I include a carriage return in a expression

    How can I include a carriage return in a expression between text strings eg
    Expression 1 = Text1 & text2 & text3 & text4
    I need to display it as below
    Text1
    Text2
    Text3
    Text4
    adjusting the box the size doesn’t work as the text strings are variable lengths

    Message Edited by Ryan.S on 01-04-2007 08:17 PM
    Ryan Shi
    National Instruments
    Attachments:
    untitled.JPG ‏37 KB

  • How can I include results of a subsequenc​e, which runs in a new thread, in the main sequence test report

    Hi!
    I', m working with TestStand Version 4.2.1. I have a main sequence, which calkls different subsequences. All these steps are properly reported. One of subsequences runs as "new thread". How can I include its results in common test report of the main sequence?
    I have markes variables of the subsequence as it is requred for test report (it works OK if it is not a new thread). If the the numerical test, which is executed in this subsequence is correct, I get no results at all. If the numeric test failed I get somewhere in the main sequence report a "red message", that test failed whithout any reference to the step or values of vaiables which were not correct.
    I tried an option "On the fly" in the Report Configuration , but haven' got any useful results. What shall I do?
    Best regards
    Solved!
    Go to Solution.

    Hi,
    I tried it but without success:
    1) I got a reference to the Thread as "Locals.Step1=RunState.Thread" for every of 2 steps which start a thread
    2) I put both "Waits" after steps with (and without) threads, at the same place, where they were before
    3) The sequence run OK, but when it came to Wait for Thread 1 it waited for ever, I had to terminate sequence
    Does it mean, that I got a false reference (suppose No - please, have a look at attached pic)?
    Or does it mean, that Waits are badly placed in the sequence (threads are already terminated)? Here is a pic of sequeces calls with Wait after them.
    Regards
    Attachments:
    Thread.JPG ‏34 KB
    SequenceCall.JPG ‏32 KB

  • How can I include a success message in a drag and drop interaction - I don't see this option in the Actions on success options, and cannot figure it out?

    How can I include a success message in a drag and drop interaction - I don't see this option in the Actions on success options, and cannot figure it out?

    I suspected you used the eye icon on the timeline to hide the message, but that one has no impact whatsoever on the published version. It is only meant to be used for editing reasons on the stage, to hide objects temporarily on a crowded stage. It is confusing, certainly in CP8 where for both instances the same eye icon is used. In previous versions the Properties panel had a checkbox for 'Show in Output', which was IMO much clearer than this eye icon. But of course, that is only my personal opinion.

  • Smartforms: how can I include a jpg picture stored an a web server ?

    I want do include a business graphic (JPG) in a smartforms window. The picture is created by a web serves and stored on a web server.
    the jpg-picture can be loaded on by an http-adress.
    How can I include the picture in the smartforms form ?
    thanks
    Richard

    hi,
    use transction SE78 to upload the picture .
    Then use it in smartforms.
    regards,
    guru

  • How can I include merged projects in the printed documentation?

    I have a master project with several merged projects. This works splendid with online documentation, but when I am asked to provide a printed version, it seems I have to create separate documents for each merged project.
    Is there any setting or fix that enables print also of merged projects and topics when I create printed documentation?
    Pretty please with sugar on top :-)

    Hm - there is a contract with the customer, saying that he wants documentation both as word and pdf, and as we now aim at only writing online documentation, these tasks create extra work, as we are delivering updates each month
    But yes - two beasts, where only chm is actually needed we think.
    -Tone
    Date: Tue, 3 May 2011 06:53:04 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I include merged projects in the printed documentation?
    Hi there
    I'm a bit curious as to the reasoning behind your "persuation process for using chm-files only".
    CHM files and printed documentation are two entirely different beasts.
    Cheers... Rick
    | http://www.robowizard.com/pc.gif | Helpful and Handy Links
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    http://www.gooberguides.com/ProductPages/RoboHelp/RoboHelp82Day.htm
    http://www.ShowMeSolutions.biz
    http://sorcererstone.wordpress.com/
    http://www.gooberguides.com |
    >

  • How can I include a portal component look and feel in a java servlet

    Does any body know how can i include a portal component look and feel (tables, buttons, etc) in a java servlet?

    Hi José,
    I don't think that is possible. But you can import the css files that ep uses for its look and feel and try to give your web pages similar look and feel. The tables and other controls used in EP are totally different and are done through complex JavaScript coding instead of simple HTML tags. If you want exact lok and feel then i thin you must go for a Webdynpro based application rather then a J2EE application with JSPs.
    Regards,
    Guru.
    PS: Give points for helpful replies.

  • How can i include a sampling of type in ps7 type tool?

    how can i include a sampling of type in ps7 type tool?   i did this in ps3

    I guess in my zest to answer your question i had forgotton about Adobe Type Reunion.
    What operating system are you using photoshop 7 on?
    photoshop 3.05 on mac os 7.6.1

  • How can i include a vi to help me save all the measurement from 10 to 100000

    hi, how can i include a vi that will store my data or save  them for each of the step increament , from the starting measurment 10hz to 10000000hz to the last. pls help
    good
    Attachments:
    saving vi.vi ‏53 KB

    Hi ifyo,
    I couldn't run your VI as i dont have all the components of it. But i have attached herewith a vi which will show you how to save continuously acquired data into a text file. The explanations are added on the block digaram. Let me know if this doesn't help and you need more information.
    Regards,
    Nitzz
    (Give Kudos to good Answers, Mark it as a Solution if your problem is Solved) 
    Attachments:
    Untitled 2.vi ‏9 KB

  • How can i include Services and Bindung in a generated WSDL file?

    Hi,
    i what to use a generated wsdl file from an erp system, to build a web service client with WSDL2Java (org.apache.axis.wsdl.WSDL2Java).
    I noticed, that services an bindings are missing, also a policy is included.
    How can i include services and bindings in the wsdl and exclude the policy?
    Thanks!

    well, I assume you have SOAMANAGER.
    choose your service & "Apply Selection" (very useless button btw)
    select a binding in the dropdown box or create on if you do not have one yet
    Click button "Show WSDL options" (actually they do not really look like buttons in WD; call it yellow blot)
    Some extra config area is thrown onto your screen (without any sense for usability or design); Change the radio button for WSDL format from "WS policy" to "Standard"; make sure the first radio button group is on "True" for monolithic
    Now click the link (why is this a link and no blot?) called "Display selected bindings WSDL URL"
    an extra text field is again thrown onto your screen somwhere between the dropdown and the WSDL option config area containing an URL (get out your glasses if you don't see the sub-10pt-letters)
    hope it helps,
    anton

  • How can I include 3rd party jar files with my custom extention?

    I'm writing an extension that is dependent upon some 3rd party jars. How can I include/package these with my extension?
    we're using the 11g tech preview
    thanks,
    Dylan

    Do you mean that you need these files to appear in JDeveloper as a library available for the developers who build a project and use your extension?
    You can create a library in JDeveloper with JAR files by simply adding the following to your extension.xml file:
    <jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension">
    - <libraries xmlns="http://xmlns.oracle.com/jdeveloper/1013/jdev-libraries">
    <library name="My Extension Library">
    <classpath> ${ide.extension.install.home}/lib/some.jar</classpath>
    </library>
    </jdeveloper-hook>

Maybe you are looking for

  • Revaluate data record at the time of loading from flat file or BI Cube

    Hello Friends, I want to revaluate a data record at time of loading using Transformation or Conversion File, based on some condition. Like, I have a rule to identify that a record is supposed to be multiplied by -1 or not. For example, *if (ID(1:5) =

  • Errors in 1z0-051 and 1z0-061 Official Oracle exam guides

    What can we do about errors in the official Oracle exam guides. I am doing the 1z0-061 (Oracle Database 12c: SQL Fundamentals). The 051 and 061 exams are exactly the same. 051 is written by John Watson and Roopesh Ramklass and the 061 is written by R

  • Tell me about external digital tuners

    I have a Sony Bravia digital TV. I have a Magnavox DVD/VCR combo. The DVD doesn't have a digital tuner. I only have an antenna (no cable) I've been told that I can buy an external ATSC receiver, but don't really know what to buy. Also...is this tuner

  • Exporting a text from illustrator to edge animate 2014.1 CC

    Hi, i would like to know if someone has succeed to export a text (with font name, color, size, ...) from illustrator to edge Animate. In the past, there was a plugin to do this from fireworks to edge animate, but now with the last version of Edge Ani

  • Re:The console changes

    Hi, We are facing an issue where we are trying to make the changes through the console, but the console is not taking the changes even though we are making changes as administrator. <Nov 12, 2010 1:07:54 PM EST> <Error> <Console> <BEA-240003> <Consol