How to include more jsp?

Hi,
I've header.jsp, footer.jsp, content.jsp (which is loaded dynamically) and a main.jsp. I would include all jsp into main.jsp.
This is the header.jsp
<div id="logo" align="top">
<img src="http://www.company.com/images/logo-red.gif"/>
<div class="user-info">Welcome, <h:outputText value="#{user.email}"/></div>
</div>
The footer.jsp is
<div id="footer">
<div id="footer-copyright">Copyright &copy; 2006 MyCompany, Inc.</div>
</div>
The content.jsp is
<h:dataTable value="#{controller.renderedSteps}" var="vitem"
rowClasses="stepdescription-text">
<h:column>
<h:outputText id="stepDescription" value="#{vitem.step.description}"/>
</h:column>
<h:column>
<h:commandButton value="next step"
action="#{controller.nextStep}"
rendered="#{vitem.isRendered}"
disabled="#{vitem.isDisabled}" />
</h:column>
</h:dataTable>
The body of main.jsp is
<body>
<f:view>
<h:panelGrid>
<jsp:include page="header.jsp"/>
<jsp:include page="content.jsp"/>
<jsp:include page="footer.jsp"/>
</h:panelGrid>
</f:view>
</body>
The problem is that when I load the main.jsp seems that the <div> are ignored.
I'm very new in JSF and JSP\HTML.
Thanks

Use f:subview and use f:verbatim.
First, f:verbatim... This JSF tag allows you to write HTML verbatim to your page. Whenever you have an HTML tag in any included page from a JSF app, it must be wrapped in f:verbatim. It is also good practice to use f:verbatim in your main page too, though it is not absolutely required. Do not wrap JSF tags in f:verbatim, it will not work.
A general rule of thumb is to attempt to use as little HTML as possible. The JSF tag set with CSS actually eliminates the need for a great deal of HTML. I suggest picking up a good book that explains each component in the JSF library. Such as Core JavaServer Faces by David Geary and Cay Horstmann. Some free chapters can be found here (Check out "Basic Standard Components): http://www.horstmann.com/corejsf/
Seconly, use f:subview when including a page. Either inside the included JSP or around the include statement. Like so:
<f:subview id="header">
    <jsp:include page="header.jsp"/>
</f:subview>
OR
<f:subview id="header">
<f:verbatim><div id="logo" align="top">
<a href="http://www.mycompany.com/">
<img src="http://www.company.com/images/logo-red.gif"/>
</a>
<div class="user-info">Welcome, </f:verbatim><h:outputText value="#{user.email}"/><f:verbatim></div>
</div></f:verbatim>
</f:subview>For more information, check out this related forum posting:
http://forum.java.sun.com/thread.jspa?threadID=715984&start=10&tstart=0
Hope this helps!
CowKing

Similar Messages

  • How to include more than 12 files in a new PDF document?

    I have a Adobe PDF Pack, and when I click on crating a new PDF document, they say that I cannot combine more than 12 files...!
    And I want to have a document of hundreds of pages!
    Someone can help me?
    Pleeeeaaase!!!!!!

    Hi Hisami,
    Thank you very, very much!
    It is very useful what you explain.
    One only question, since I have the trying version of Acrobat Pro: how many files can you combine at the time with it?
    May be it depends on the files size.
    I tried yesterday to combine 50 files at the time and it just blocked everything...
    Thanks a lot!
    Have a very good day.
    Henric
    Henric Caldas
    30 rue de Belleville
    75020 Paris
    Home : +33.1.46.36.04.55
    Mobile : +33.6.59.08.02.27
    [email protected]
    Le 28 janv. 2014 à 22:48, "H.Spector" <[email protected]> a écrit :
    Re: How to include more than 12 files in a new PDF document?
    created by H.Spector in Adobe PDF Pack (formerly CreatePDF) - View the full discussion
    To combine more than 12 files into a single PDF file:
    1. Combine file 1 to file 12 then name it (combined 1 for example)
    2. Combine file 13 to file 24 then name it (combined 2 for example)
    3. Keep doing those steps #1 and #2 then combine "combined 1, Combine 2.....Combine 12).
    Another way is to use Adobe Acrobat. Please download Acrobat XI Pro Trial version from www.adobe.com or you can upgrade your subscription to Acrobat Plus(please see more information about Acrobat Plus subscription at https://www.acrobat.com/acrobatplus/en/home.html?trackingid=JPZKR).
    In Acrobat XI Pro:
    1. Launch Acrobat
    2. Select "File" menu > Create > Combine Files into a Single PDF
    3. Click "Add Files" button at top left corner
    4. After adding your files click "Combine" button at the bottom of the dialog.
    Thank you
    Hisami
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6062261#6062261
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6062261#6062261
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6062261#6062261. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe PDF Pack (formerly CreatePDF) at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How to include a jsp page in another jsp jsp page

    hi,
    i m trying to include a jsp page name "header.jsp" into one jsp page name"selectattribute.jsp" i m using these commands in "selectattribute.jsp"
    <%@include file "header.jsp"%> bcz both these jsp page are C:\program files\tomcat 4.0\webapps\examples\jsp\Poject\
    but the problem is that , i m invoking this jsp page "selectattribute.jsp" from a servlet reportcontroller.java using REQUEST DISPATCHER.
    the servlet is in
    C:\Program files\tomcat 4.0\webapps\examples\WEB-INF\classes\Project\
    i want to know how to include some other jsp page in a jsp page and how to invoke applet from jsp page when that particular jsp page is being invoked by servlet.
    plz help
    manish

    use this for including in your selectattribute.jsp
    <jsp:include page="header.jsp" flush="true"/>
    I never tried calling an applet. I think you can write the code for calling the applet in a javabean method and call the method in the jsp

  • How to include a jsp in child window?

    Hi,
    I've a jsp which creates a new window(a new jsp using window.open()) while clicking a button.In the new jsp i'm including another jsp using ,
    <jsp:directive.include file="first.jsp"/>
    but in the window jsp's is not getting included.I've tried <%@ ..
    include also.But all in vain.
    Additionaly I'm giving css in the window using
    <link ref="stylesheet" href="/editor/mystyle.css"/>
    which is also not working.
    Can somebody help on this?
    Thanks,
    Shabeer.

    hi
    I think this url can helps to your for resolve your issue.
    http://www.oracle.com/technology/sample_code/tech/java/jsps/ojsp/jspxml/Example.jsp.html
    Regards,
    Sridhar

  • How to include a jsp file in servlets and javabeans

    Hi to all..I have a jsp file which contains some database connections and I would like to include in that file in my servlets and javabeans.What coding can i use?Can show me sample coding.

    Hi to all..I have created a javabean storing the
    database connections. How do i include and call that
    bean in my servlet and javabeans?Can pls show me some
    sample coding?I am new to servlets and beans.The same way you do with normal Java Classes. If you are new to Java, I suggest you go to http://java.sun.com/docs/books/tutorial/index.html and look through the first couple of tutorials.
    As a note, it is best to put all your objects into packages, especially if you use JDK 1.4 or higher.

  • How to include more than one input ready rows in analyzer

    Hi Gurus,
            I have a requirement that, I need to have more than one input ready rows at the end of the query output in analyzer.
       Normally it will show only one row as input ready at end of the query result in any manual planning analyzer., But my requirement is to have multiple input ready rows in analyzer. Is it possible in workbook/analyzer?.
    Thanks,
    V.Senthil

    Hi Senthil,
    Have a look at the below thread.
    How to add new rows for input ready query in BEx analyzer
    Regards,
    Venkatesh

  • How to include a JSP page contained in a JAR file ?

    Hello,
    I have a Servlet in which I would like to include, in the Response, the content of a JSP page contained in an external JAR file included in my lib directory ?
    Could someone help me please ?
    Thanks in advance.
    bgOnline

    I don't think thats possible with the standard j2ee server.
    There are probably ways around it, but it would involve a large component of custom coding.

  • How to include a jsp file from other site

    Hi all,
    I met a problem in my recent work. I need to include another seperate jsp file into my current jsp file, but the file is located at the different site (different physical server). Is there a way to include?
    Cheers
    Chris

    Thanks tolmank, but our weblogic server didn't support jstl, so when I try to using <c:import.. > it doesn't work. If I use <jsp:include page="..."/>, nothing display on the page.

  • How to Include more than one jar files

    My application uses more than one jar files. And all the jar files i am using are signed. when i include the jar files, i am including them in the resources section of the ".jnlp" file . The section of code looks like this:
    <resources>
    <jar href="utestfw.jar" main="true" download="eager"/>
    <jar href="crimson.jar"/>
    <jar href="jaxp.jar"/>
    </resources>
    <application-desc main-class="utestfw.ObjectBrowser"/>
    The deployment of the application is successful. The jar file - "utestfw.jar" contains the application main class when the application is launched it works, but when i choose the feature which involves the classes of either "crimson.jar" or "jaxp.jar" , the application terminates and the webstart console and the application is closed automatically. Am i wrong in adding the jar files? what is the way to add more than one jar files to the ".jnlp" file.
    Can anyone please help me?
    -Aparna

    I'll post u the jnlp file which i am using. To sign all the jars i've used the same alias ( a self signed certificate using keytool and jarsigner).Here is the jnlp file:
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="0.2 1.0"
    codebase="http://127.0.0.1:8080/healthdec"
    href="testTool.jnlp">
    <information>
    <title>Unit Test Manager </title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <description>A minimalist drawing application along the lines of Illustrator</description>
    <icon href="images/testing.gif"/>
    <offline-allowed/>
    </information>
    <resources>
    <j2se version="1.3+ 1.2+"/>
    <jar href="utestfw.jar" main="true" download="eager"/>
    <jar href="crimson.jar" main="false" download="eager"/>
    <jar href="jaxp.jar" main="false" download="eager"/>
    </resources>
    <application-desc main-class="utestfw.ObjectBrowser"/>
    <security>
    <all-permissions/>
    </security>
    </jnlp>
    Can u please look at the above code and suggest me where i am wrong. Thanks.
    -Regards
    Aparna

  • How to include more than one scan in the outgoing email

    ever so often I wish to scan several pages to be included in one outgoing email-how do I do that?

    4683,
    Welcome to the HP Community Forum.
    The following may help with the following caveat:  The document was written to explain how to create a combined scan.  It does not include emailing the output.
    Scan_Multiple_Documents-Combine
    NOTE Page 4 of the document:  Where it shows "Do Nothing", you would want to CHECK "email the file(s)".
    Click the Kudos Thumbs-Up to show you appreciate the help.
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Click Accept as Solution when the Answer provides a Fix or Workaround!
    Kind Regards,
    Dragon-Fur

  • How to Include More Than One Font and Font Color Within a Fluid Grid Div Tag?

    Using CSS code, I can make all the words within a fluid grid div tag the same font, font size, and font color, but how do I make a few of the words different?

    You can style the basic text and heading selectors with CSS:
    p { }
    h1 { }
    h2 { }
    h3 { }
    h4 { }
    etc...
    And you can make classes:
    .red {color:red}
    .highlight {background-color:yellow}
    Then apply classes to your text or sections of it using the HTML properties panel.
    <div>
         <p>This is a default paragraph style.</p>
         <p class="red">This is red.</p>
         <p class="highlight">This is highlighted.</p>
         <p>Default style with <span class="red highlight">red, highlighted text</span> and normal text.</p>
    </div>
    Incidentally, this will work in any layout.
    How to Develop with CSS?
    http://phrogz.net/css/HowToDevelopWithCSS.html
    Nancy O.

  • Include a JSP inside another JSP

    Hi SDN,
    I am stuck with a problem. There is a JSP file available. In this JSP I have to add some more fields. But when I try to ad new fields I am getting a Portal Runtime Error stating that "Code Too Large". So now I thought of putting the new code in another JSP and include that JSP inside my main JSP. Here I cannot use <@include file="..."> because this finally compiles both the JSPs as one.
    So I tried to use <JSP:include>. Some one please help me with how to include a JSP inside another using <JSP:include>. Here both the JSPs are having HBJ content inside.
    I know that <jsp:include page="relPathOfChild.jsp"/> will include the child.jsp into my main jsp. Problem is both the JSPs are having HBJ content, so If I dont declare <hbj:content> tag inside the child jsp, it is throwing an error. But If I declare a <hbj:content> tag inside my child jsp, only child content is coming and main jsp content is not coming.
    Please help me..
    Regards,
    SrinivaS

    Hi,
    This Problem is solved. Now I am able to include a child JSP inside the parent JSP. But now the problem is,
    This Parent JSP will have 8 tabs. Now my chils JSP should come inside 7th tab.  but it is coming above the parent JSP.
    Below is how I am including my child JSP.
    <% try{ if(isCAR){
         %>
                   <tr>
    <jsp:include page="/pagelet/CAREligibility.txt" />
                   </tr>
                <%} } catch(Exception e) {}%>
    Please help.
    Regards,
    SrinivaS

  • Including a jsp page onto other jsp

    Could any one tell me how to include a jsp on other jsp
    For ex: including header.jsp and footer.jsp on all pages of application.
    Thanks

    There are a number of ways.
    You can copy/paste the contents of header and footer into each and every individual jsp file in your system.
    You can use <jsp:include>
    You can use the include directive <%@ include %>
    (JSP2.0 required) You can configure a "prelude" and "coda" in web.xml which are automatically included like directives at the top and bottom of every JSP page.
    Cheers,
    evnafets

  • How to include an ASP page from JSP?

    I had a working ASP page to be repeated on each page of the web site as an navigation bar updated from a single SiteMap.xml. Anyone knew how to include the ASP page from the JSP app?
    Thanks

    You might achieve your desired result by calling the ASP page from your JSP controller (server side) using the standard JAVA HTTP classes you could then process the resulting XML. I suggest you look at the JAVA API for more information in particular the JAVA.NET package and the HTTPUrlConnection class...
    http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html
    Hope this helps,
    BRgds,
    Simon

  • How can I include a JSP, Maximized, and retain look and feel(WSRP)

    I have created a page group and defined a root page with a certain look and feel. There are two portlets on the page. Once the user clicks on a submit button, the portlet performs some action and includes a jsp included in the EAR file. The portlet needs to maximize the UI to display the jsp correctly.
    Once control returns back to the screen, the look and feel is lost and uses Oracle's default style. I have two questions:
    1. From the portlet, how can I retain the look and feel of the page group when referencing "external" jsp (i.e JSPs in the deployed portal EAR file).
    2. How can I "redirect" the user to the home page in a standard way? If there is not a standard way, how do I use the Oracle specific utilities to do it?
    All of my JSPs are developed externally out of the scope of the Oracle Portal.
    Environment - Oracle Portal 10.1.4 on Release 2 using WSRP to contact Oracle Release 3, hosted EAR file (WSRP Producer).
    Thanks in advance.

    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.

Maybe you are looking for