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

Similar Messages

  • 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 to include element on page TOC in dynamic converter

    Hi,
    I am trying to create TOC in dynamic converter, when I open edit template, select element, and properties, check on include in page TOC, Click OK to close properties window, then come back to take look the change, the check is gone. it happens to all the elements. How to include element in page TOC? are there other steps have to be done before elements can be added? Thanks!
    T.J.

    JSP tags don't add html elements. Add the html and body elements as listed:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:pe="http://xmlns.oracle.com/adf/pageeditor"
              xmlns:cust="http://xmlns.oracle.com/adf/faces/customizable">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <html>
      <body>
      <af:pageTemplateDef var="attrs">
        <af:xmlContent>
          <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
            <display-name>sampletemplate</display-name>
            <facet>
              <facet-name>content</facet-name>
            </facet>
            <attribute>
              <attribute-name>hideBreadcrumb</attribute-name>
              <attribute-class>java.lang.Boolean</attribute-class>
              <default-value>#{false}</default-value>
            </attribute>
          </component>
        </af:xmlContent>
       <af:resource type="javascript" source="//scripts/code.js"/>
      </af:pageTemplateDef>
      </body>
    </html>
    </jsp:root>

  • How to include 2 jspx pages in one jspx page and should navigate each other

    Hi,
    How to include 2 jspx pages in one jspx page. When I click on submit button in one page I should able to display those values in another jspx page.
    Plz give me systax or any examples on this requirement.
    Thanks

    I divided one jspx page into 2 parts(Left and Right). In Left side part contain Tree component. Onclick on any node in Tree component, Include another jspx page in Right side. The included jspx contain one submit button. If I click on that button corresponding backing bean is not getting call.
    If I tested with individual pages its working fine. It is getting fail when ever I included jspx page into another.

  • How to include other web page in servlet response?

    Is there any way how to include the contents from some other web page in my own response? For example, I wish to printout some text and below that to put the complete contents of let's say Google's page, so something like:
    include("www.google.com");
    ...So far I found that I can either redirect to that page and l fully lose the control or include the contents of the other jsp or servlet that I made in the same project. I know I can just send the request to that outside page and read the response and print it out on my page, but the problem is when there is a JavaScript and I can't get the rendered contents but just that script. Also, I will not be able to see the images in that case, so I prefer to give the command to web browser to render and show it for me.
    Thanks a lot for any help!

    I already tried with streams but then just original source is written, so it means that if it is calling some scripts I will get JavaScript code instead of executed result. I thought I must somehow make the browser to process the page and just display the output because it knows how to deal with scripts.

  • 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

  • How to Include a ZUL file in another ZUL file

    Hi
    I need to Include a ZUL file in another ZUL file
    which is not in same JAR. Both are in different JAR.. but i want to Include that...!
    Thanks...!

    You want to include a ZUL file, whatever that is, that's in one JAR inside another ZUL file that's in another JAR? I don't even understand the question. Get it out of the first JAR and include it inside the 2nd ZUL file ???

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

  • Without Changing the RecordsDisplyed property how to include in 1 page

    hi,
    Actually i have designed a table in which i add rows by clicking a button when the rows are increasing more than 10 it goes of to next page. The basic functionality is intact but the overall functionality i.e after all completions of rows i kept a button which calulates the total but since its going of to next page its not working but when its in a single page it's working.Previously i used fetchrowcount() method then i used getAllRowsInRange() method still no result.....
    any suggestions how to overcome this

    You need to tell us as to how you are iterating through the Rows in the VO. I believe you are using APIs, that fetch only the rows in the current Range. For you total requirement, you should be traversing through rows in all the range indexes of the VO.
    You can create & use a RowSetIterator to iterate over all the view object rows.
    Please see "Iterating View Object Rows" in JDEV_CLIENT_INSTALL\jdevdoc\devguide\bus\bus_vo.htm#itr
    HTH.

  • How to include non web pages to the "Create PDF from Web Page" feature?

    In Acrobat Pro (v. 10), when I use the "Create PDF from Web Page" feature, it works great for html pages, but it skips non-html links (doc, pdf, ppt, xls, etc). I need Acrobat Pro to convert those files and put them in the order as well. I don't see an option for this in settings. Is there ANY way I can do this? This is for an archiving purpose and I have 10,000 plus files to convert. Please help.

    This is a question i'm trying to answer too. My issue is that I have a PDF file which itself contains links to both DOC and PDF files. The end result is that I need one consolidated PDF containing all the linked files (in order).
    I can run the "create from web page" on this PDF file, and it'll download them, but not convert them. It just adds them as "jumbled" text to the end of the document. I need it to download, convert, and then append them.
    So, as isunshine3 asked above, any way to have Adobe convert the files that it finds linked when running the "create from web page"?
    THanks
    Matt

  • How to include one xml file into another

    Dear Sir/Madam!
    Could you do me a favour and help me to solve the problem like this:
    I have one xml file wich describe the common thins of the GUI, and the another will be generated depending on the point the user has selected.
    I would be very pleased for any helpful assistance.

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <xsl:variable name="xml1" select="document('xml1.xml')"/>
    <xsl:variable name="xml2" select="document('xml2.xml')"/>
    <xsl:copy-of select="$xml1"/>
    <xsl:copy-of select="$xml2"/>
    </xsl:template>
    </xsl:stylesheet>

  • 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

Maybe you are looking for