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

Similar Messages

  • 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...

  • How can I set a JSF page to accept requests from outside

    I have a file upload page in my application(JSF and MyFaces). It works fine when I navigate to page and select the file to upload and submit. Do I need to make any changes to this page to post from an external system?
    I created a perl script to send a file to this page. When I called the URL for this page, it returned the page content. How can I submit from the perl script?
    <h:form id="apppostform" name="apppostform" enctype="multipart/form-data" >
              <h:panelGrid styleClass="mbformdata" columns="2" border="0" cellspacing="25" cellpadding="0">
              <h:outputText value="#{appmsg.prompt_upload_file}"/>
              <t:inputFileUpload id="fileupload"
              value="#{fileUploadForm.upFile}"
              storage="file"
              styleClass="fileUploadInput"
              />
                   <h:commandButton type="submit" value="submit" action="#{fileUploadForm.uploadFile}"/>
                   </h:panelGrid>
    </h:form>
    Thanks,
    rm

    I created uploadservlet. I specified in web.xml:
    <servlet>
    <servlet-name>uploadservlet</servlet-name>
    <display-name>UploadServlet</display-name>
    <servlet-class>servlet.UploadServlet</servlet-class>
    </servlet>
    When I try to access uploadservlet, I am getting 404 error.
    I have few questions:
    How does it know about uploadservlet if it is not inherited from facesservlet while using JSF?
    Do I need to add any info about this in faces-config.xml?
    Please help!
    Thanks

  • Friends..how can i include a jsp page in a servlet

    like i want to use like
    if(conditionl)
    out.println(" welcome");
    //////// here i want to include some jsp page /////
    I tried with...
    <% @include %> but its not working
    Thanks in advance

    I tried with...
    <% @include %> but its not working
    Thanks in advanceThat only woks for JSP Pages.
    You have to call the include method of the RequestDispatcher
    if(conditionl)
      out.println(" welcome");
      getRequestDispachter("/myJSPDir/my.jsp").include(request, response);
    }

  • How to add fragment in jsf page using include tag in jdeveloper

    Hi all
    Can you tell me wat is syntax of using include tag .or how to add fragment in jsf page ..
    Edited by: 947228 on Jul 18, 2012 5:01 AM

    Hi,
    Why do you want to do that?
    Check [url https://blogs.oracle.com/jheadstart/entry/avoid_use_of_jspinclude_where]this out before proceeding further.
    Btw, always mention your JDev version, clear usecase to get help.
    -Arun

  • How can I make a decorative page border in Pages?

    How can I make a decorative page border in Pages?

    Hi Janet,
    I suppose that you are asking how to include a decorative border of your design into a pages document. How you design that border is rather out of the range of these discussions. So, let's say that you have a graphic that approximates a picture frame and has the required dimensions to frame your content.
    If you want to have the graphic appear on every page, Drag or Insert > Choose, to incorporate your design in to the document. The position it as you want it, and then Arrange > Send to Background and Format > Advanced > Move Object to Section Master.
    If there is more than one section in your document, there may be more considerations, but if you do this at the outset in the creation of your document, the design of the first section will flow to subsequent sections.
    Regards,
    Jerry

  • 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 stop the Drudgereport page from autorefreshing? None of the standard answers work.

    How can I stop the Drudgereport page from autorefreshing? None of the standard answers work.
    ''locking - https://support.mozilla.com/en-US/questions/775159 ''

    Drudgereport includes JavaScript code that refreshes the page. You could disable JavaScript for the drudgereport site, that will stop it from refreshing. You can do that by installing the [https://addons.mozilla.org/firefox/addon/4922/ YesScript] extension which allows you to block JavaScript on sites that you specify.

  • How can i print just one page of photo book without printing the entire book

    how can i print just one page of photo book without printing the entire book

    Jim,
    Take heart.  We can help.
    First turn on page view so you can see how the content of your sheet fits on the page(s).  A Numbers document contains sheets (listed on the left) which in turn contain tables, charts, text, and graphics.  Select the sheet you want to print on the left, then enable page view by selecting the menu item:
    "View > Show Print View":
    Now you should see your content and how it fits on one, or more, pages.  If thie content is too big for one page use the controls and the bottom left of the window to expose the sheet controls:
    Here a table is too big to fit on one page:
    slide the "Content Scale" slider so the content fits:

  • How can I view as "single page continuous" in full screen mode?

    how can I view as "single page continuous" in full screen mode?
    preferences->page display:
    preference->accessbility:

    Not possible.

  • How can we define custom error page in protal application

    How can we define custom error page in protal application, like we define "jsp Error page " in JSPs

    Hi,
    Check these:
    Customization of Portal Runtime Errors and portal standard error codes
    http://help.sap.com/saphelp_nw04/helpdata/en/9a/e74d426332bd30e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ec/1273b2c413b2449e554eb7b910bce7/frameset.htm
    Regards,
    Praveen Gudapati

  • How can I make a intro page for my website, then after the intro has run make the page automatically change to my we site home screen

    how can I make a intro page for my website, then after the intro has run make the page automatically change to my website's home screen

    You can do this using a meta refresh but the problem is you have to add it to the html file for the page very time you publish changes.
    A better way is to create a splash page and upload it to the server outside of the folder produced by iWeb. Example HERE.
    The meta refresh is added to the head section of the html file...
    <meta http-equiv="refresh" content="32;url=http://www.domain.about.com/Page-Name.html">
    The delay time in seconds is marked in blue and the URL to the redirect page is in red.

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • 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

Maybe you are looking for

  • How can I transfer pictures from my iphone 4s to my PC?

    How can I transfer pictures from my iphone 4S to my PC without downloading itunes?

  • Java.lang.NullPointerException in DataCacheManager

    java.lang.NullPointerException at kodo.datacache.DataCacheManager.<init>(DataCacheManager.java:43) at kodo.conf.JDOConfigurationImpl.getDataCacheManager(JDOConfigurationImpl.java :1356) at kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceMana

  • How to refresh a page in apex, once it is loaded

    Hi friends, I need to refresh the entire apex page automatically, once after the page is loaded. How to achieve this in apex. Whether need to use any DA for the auto-refresh. If so, can you kindly help me with that guys. Thanks Brgds, Mini

  • Error in Table T460B

    Hi, When i am trying to display the special procurement type in SPRO system giving message "Please Maintai Table T460B" Please help to resolve this issue. Regards Sandip

  • Spotlight mp3 search results - showing song title only

    Hi, Since upgrading to 10.9 spotlight only shows the tag of the songs instead of the filename. this is really annoying. Is there any way to fix this? Thanks, Udi