Include a page .jsp

It is possible to include a page .jsp in another page???
How??
thanks

Perhaps you mean a page fragment (jspf)?
If so, see http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html

Similar Messages

  • In a jsp page how can i include another page from differenct web context

    Hi,
    i want to include a page from another web content to my page. How is it possible. For example in a jsp page i want to include "http://www.google.com". How is it possible. can i use <jsp:include tage for this purpose? any idea?
    Edited by: JavaHeroPrince on Apr 2, 2009 12:05 AM

    I'm afraid you cannot do that using <jsp:include/> tag.
    However, you can achive this using <c:import/> tag which comes with JSTL core tags.
    Please find the below example of how to go about.
    <%@ taglib uri = "http://java.sun.com/jstl/core" prefix = "c"%>
    <c:import url = "http://www.google.com/search">
      <c:param name="q" value="c%3Aimport+jstl"/>
      <c:param name="rls" value="com.microsoft:en-us"/>
      <c:param name="ie" value="UTF-8"/>
      <c:param name="oe" value="UTF-8"/>
      <c:param name="startIndex" value=""/>
      <c:param name="startPage" value="1"/>
    </c:import>
    -------------------------------------------------------------------------for more info
    [http://java.sun.com/developer/technicalArticles/javaserverpages/faster/]
    Hope that helps :)
    REGARDS,
    RaHuL

  • Dynamic include file in JSP page

    <span class="value">Hi
    i have index.jsp , this page can include jsp
    pages dynamically by passing the name of the page to be included to the
    index page with out .jsp , so if i want to include page "code.jsp" i
    put: .../index.jsp?page=code , this have to include code.jsp page
    i made the following code , but it did not find the file
    so can any one help plz ?
            String pg=request.getParameter("page");
            if( pg!= null && ! "".equals(pg)){
                    File f=new File(request.getParameter("page")+".jsp");
                    if(f.exists()){
                            out.print("file exist");
                            %>
                            <jsp:include page="<%=request.getParameter("page")+".jsp" %>" />
            <%
                    }else{
                            out.print("file not exist");
         

    What does the file existing or not really have to do with it?
    You can try it like this:
    String pg=request.getParameter("page");
            if( pg!= null && ! "".equals(pg)){
                    String webPath = pg + " .jsp";
                    String realPath = request.getRealPath(webPath);
                    File f=new File(realPath);
                    if(f.exists()){
                            out.print("file exist");
                            %>
                            <jsp:include page="<%= webPath %>" />
            <%
                    }else{
                            out.print("file not exist");
            }Alternatively you could try using a request dispatcher:
    RequestDispatcher rd = request.getRequestDispatcher(webPath);
    if (rd == null){
      // doesn't exist
    }

  • Workshop 8.1 - jsp:include an Page Flow action resource

    Hi everybody.
    Can i use jsp:include to "include" a page flow action ?
    I've tried it, but odd things are happening: The resource got included, but fragments of html source "around" it are been lost.
    Any ideas ?
    Thanks in advance.

    Hi everybody.
    Can i use jsp:include to "include" a page flow action ?
    I've tried it, but odd things are happening: The resource got included, but fragments of html source "around" it are been lost.
    Any ideas ?
    Thanks in advance.

  • How to include a page conditionally ?

    Hi all !
    I have a web page made of different sections. Every section is included in a separate page.
         <f:view>
              <h:form>
                                <%@ include file="filters.jsp" %> 
                    <%@ include file="dataTableAdmin.jsp" %>       
                    <%@ include file="modalPanel.jsp" %> 
                                   </h:form>
         </f:view>Now I have the requirement that some sections should be visible only to the admin users.
    The roles are referenced in a Bean registered in faces-config.xml.
    How can I include a page depending on the value of the Bean ? I'd need something like the "rendered"
    attribute on the "include" tag, but I'm afraid it doesn't exist......
    Do you have any suggestion ?
    Thanks alot
    Francesco

    Put the include into a panelgroup and use the rendered attribute...

  • Include file in jsp not working

    Hi ,
    I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
    My include code looks like this :
    <%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
    <!--#include virtual="includes/footer.html" -->
    My jsp file is hosted on IIS

    nb123 wrote:My jsp file is hosted on IIS
    Hi ,
    I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
    My include code looks like this :
    <%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
    <!--#include virtual="includes/footer.html" -->
    My jsp file is hosted on IIS
    Check the path you've specified. It may well be;
    <%@include file="hello.jsp" %>or
    <%@include file="/Includes/hello.jsp" %>

  • Include jspx page in af:regionDef

    Does any body know how to include a jspx/jsp page in <af:regionDef>
    tag
    Thanks in advance

    Make that as another region & you can include that region..
    <af:regionDef var="attr">
    <af:region id="_id0" regionType="AnotherRegion"/>
    </af:regionDef>

  • How to include psp in jsp

    can you tell me the information through which we can include psp in our jsp pages with the <jsp:include/> tag ,since it is mentioned by oracle documentation we can include psp pages in our jsp.
    So can somebody give me the solution since in my project I have to use psp and jsp both .So please help me out for this.

    No it is not possible.
    Include directive is like copying and pasting some text into a JSP file, and then translating/compiling it.
    So the only thing you can include with the <%@ include %> directive is a jsp fragment
    It is a static translation/compile time include and thus will always be the same
    By contrast <jsp:include> is a runtime include, and includes the result of running the imported url.
    That URL has to be a complete/standalone jsp/servlet/whatever. However as it is runtime, it can take parameters where the include directive can not.
    Does that answer your homework question?
    Cheers,
    evnafets

  • "include directive or jsp:include "

    Hi,
    Which amongst <%@ include file="header.jsp" %> and
    <jsp:include page="header.jsp"/>to be used, when performance is taken into account.

    Code copy from serverside.com
    Is it the same as --> jsp:include and %@ include directive.
    Actually, <jsp:include> vs. <%@ include %> is a different story.
    <%@ include %> is a "compile-time" include. The included file is inserted into the JSP when the JSP compiles.
    <jsp:include> is a "run-time" include. If JSP-1 includes JSP-2, JSP-2 is invoked when JSP-1 executes, and the output of JSP-2 is inserted into the output stream of JSP-1.
    The run-time include runs a bit slowly, but can save a lot of system memory, so in general, the run-time include is preferable. Only use the compile-time include if the include code must be in the same page.
    For example, if you want to use an include that defines a bunch of tag libraries with the taglib directive, it will have to be a compile-time include. If you just want to insert a standard header and footer in your page, a run-time include will be more effecient.
    I hope its enough for you to get an clear cut idea,

  • Include dynamic pages

    Hi i have a jsp page(page1) which includes another jsp file (page2), but the name of (page2) jsp file is dynamically generated. I tried using <jsp:include="<%= variable %>" />, but it's not including the page2, it's giving error.
    Please check the below example
    <%@ page language="java" %>
    <%@ page import="oracle.apps.apt.aptWebHomeNews" %>
    <%
    aptWebHomeNews lHomeNewsObj = new aptWebHomeNews();
    lHomeNewsObj.getBrandInfo(_connection,gBrandNameStr);
    String lNewsPageStr="";
    String lErrStr;
    lNewsPageStr = lHomeNewsObj.getPageName();
    lErrStr = lHomeNewsObj.getStatus();
    lNewsPageStr = lNewsPageStr + ".jsp";
    %>
                   <table >
                        <tr height="20" > <td> </td> </tr>
                   </table>
              <table width="272" cellspacing="0" cellpadding="0" border="0">
              <% out.println("lNewsPageStr is " + lNewsPageStr); %>
    <jsp:include page="<%= lNewsPageStr %>" />
    <%-- @ include file="aptFndIncNewsComm.jsp" --%>
    <tr>
              <td align="center" width="270">
                   <table width="270" cellspacing="0" cellpadding="0" border="0">
    <tr>
         <td width="270">
                   <%@ include file="aptFaqInccatsolnpop.jsp" %>
    </td>
              </tr>
                   </table>
                   </td>
              </tr>
    <tr>
    <td height=30>
    </td>
    </tr>
              </table>
    Could anyone let me know what is the issue.
    Thanks,
    Raj.

    1. Please make sure that dynamically generate jsp is available in $OA_HTML
    The <jsp:include> element allows you to include either a static or dynamic resource in a JSP page. The results of including static and dynamic resources are quite different. If the resource is static, its content is included in the calling JSP page. If the resource is dynamic, it acts on a request and sends back a result that is included in the JSP page. When the include action is finished, the JSP container continues processing the remainder of the JSP page
    Hope this helps.
    Thanks,
    RK

  • Pls tell me use %@ include file="myfile.jsp"% with endcoding UTF-8??

    My jsp pages use some endcoding as UTF-8.
              When I use <%@ include file="myfile.jsp"%> endcoding lose format UTF-8. But
              if I use <jsp:forward page="myfile.jsp"/> it work fine.
              Pls tell me use <%@include %>
              (I use Jbuilder 6 and weblogic server 6.1)
              Thanks .
              

    From http://java.sun.com/products/jsp/tags/12/syntaxref1214.html#8828 (emphasis mine):
    page="{ relativeURL | <%= expression %> }"
    The relative URL that locates the resource to be included, or an expression that evaluates to a String equivalent to the relative URL.
    The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP page. If it is absolute (beginning with a /), the pathname is resolved by your web or application server.
    You could use a servlet in your "path" attribute and have that servlet read and return the page from a different server; there are ways to do what you want, but <jsp:include> isn't one of them.

  • Problems with include where the include is a jsp

    Hi ,
    I have a typical problem. The iplanet server doesn't interpret the code
    from a jsp which is included in another jsp. For eg.
    code for main jsp
    request.getParameter("username");
    <%@ include file="/jsp/ui/left_nav.jsp" %>
    processing code.
    Now when I start the server and the first time I load this page I get a
    dearranged page which has the code of the left_nav.jsp present in the html
    output.
    On opening this page to edit, when a small modification is made and the file
    is saved, a reload of the same page gives the proper output with all the
    jsp's interpreted.
    Thanks to one and all,
    Regards,
    Gurjit

    You definitely want to use a jsp include action, not a directive. The directive
    happens at translation time and does not process the requested page. An action
    happens at request time and treats the requested page as a new request, thus
    including the results of the invoked jsp.
    BTW, the include action is the tags that looks line <jsp:inculde
    page="included_page.jsp" flush="true"/> or something similar (parameters can
    also be specified).
    The JSP 1.1 spec has more details. See sections 2.7.5 & 2.7.6 (for the include
    directive and a quick comparison of the directive vs the action) and 2.13.4 (for
    the include action).
    Matt
    Gurjit wrote:
    Hi ,
    I have a typical problem. The iplanet server doesn't interpret the code
    from a jsp which is included in another jsp. For eg.
    code for main jsp
    request.getParameter("username");
    <%@ include file="/jsp/ui/left_nav.jsp" %>
    processing code.
    Now when I start the server and the first time I load this page I get a
    dearranged page which has the code of the left_nav.jsp present in the html
    output.
    On opening this page to edit, when a small modification is made and the file
    is saved, a reload of the same page gives the proper output with all the
    jsp's interpreted.
    Thanks to one and all,
    Regards,
    Gurjit

  • Including a page flow in header

    Hi all,
    I want to include a page flow in header section of a portal.
    I tried with JSP:include tag , but I'm getting message unable to find action .
    Is it possible ?
    thanks,
    sathish

    Sathish-
    Through the use of custom and standard controls, I have incorporated authentication
    and user management in my jsps. There is a netui tag that you can utilize to
    reference a control. I have found the easiest way to add a control is to drag
    it from my tree onto the JSP.
    As for getting pageFlow into my header, I haven't tried yet.
    Eric
    "Sathish Venkatesan" <[email protected]> wrote:
    >
    Eric,
    I have checked with support. This functionality is not supported in the
    current
    release.
    I want to try a different approach.
    I want to use a custom java control in jsp ?
    Did you had a chance to try it out and had any luck ?
    thanks,
    sathish
    "Eric Ballou" <[email protected]> wrote:
    Sathish-
    Have you tried a global pageflow? Also, did you include the netui tags
    in the
    pageflow? I personally have thought about doing the same, but I was
    concerned
    about using the jsp:include as some session information doesn't always
    transfer
    or call properly in an include. One idea may be to use a reference/render
    to
    a portlet. Those are just approach ideas I haven't tried, but may soon.
    Hope
    that at least gives you a starting point.
    Eric
    "Sathish Venkatesan" <[email protected]> wrote:
    Hi all,
    I want to include a page flow in header section of a portal.
    I tried with JSP:include tag , but I'm getting message unable to find
    action .
    Is it possible ?
    thanks,
    sathish

  • Including jsf pages

    Hi,
    I am trying to write a small jsf app. I am tyring to modularize it and having problems with <jsp:include..>. When I include a page with a jsf fragment it fails to render anything. Am I doing something wrong?
    Thanks
    BJ

    The sample applications at
    http://www.crossbar.info/
    contain working examples of the use of
    <%@ include file="whatever.jsf" %>
    to build modularized pages that avoid duplicationof
    code. Right, it may work fine for some simple cases. All I
    meant was that the behavior is not really specified,
    and there are therefore a number of cases where it
    doesn't work at all. It's on the list of things the EG
    will look into.Doh! You're using static includes. I read it as if you were saying that you got dynamic includes to work.

  • How do I include a page from web search into an Email?

    I have a HP TouchSmart 610-1147c Desktop computer. running Windows 7 64 bit.  I should have known the answer to this question years ago, but I don't....terrible huh?  Anyway, how do I include a page from a web search that I did into an Email?  Believe it or not, I've never had to do this before, so don't have the faintest idea how to do this.  I have a feeling that it would be sent as an attachment, but how don't know how to do that!!
    I would appreciate any help that anyone would take the time to give me.  I thank you beforehand for having patience with me and my silly question.
    Auntie CC
    This question was solved.
    View Solution.

    Well, the way I would do it is to copy and paste the web address in the email, so the recipient can click on the link and get right to the Web page.
    For example, I just googled "horses," and here is the result of that search:
    http://www.google.com/#hl=en&output=search&sclient=psy-ab&q=horses&oq=horses&aq=f&aqi=g4&aql=&gs_l=h...
    I highlighted the Web address, copied it, and then pasted it in the response.  Same thing can be done into an emial.
    Does that make sense?  Or were you looking for something else?
    GeorgeFN
    GeorgeFN
    I work on behalf of HP.

Maybe you are looking for

  • Can't create a new folder in ECP 3

    Hello, I downloaded ECP 3 this morning and I can't seem to be able to create a new folder in the sidebar. I get an "NotReadableError" message when trying to make a folder. Is this intentional because of the "preview" status of the release? The follow

  • Displaying iPad on TV using Apple TV

    I have bought an Apple TV and wish to display my Mini iPad on my TV. I understand I have to select Airplay in Control Centre to do this but there is no Airplay button showing in my Control Centre.   I have iOS 7 installed on my iPad.  How do I get Ai

  • Oracle Databases and Storage Systems like HP EVA

    Hi everybody, are there generel advantages or disadvantages using such storage systems? I would be happy if somebody could talk about his experience using such systems. Is there better/less performance with Oracle Databases? Better/less Security for

  • Do you offer a trial pdf to excel conversion?

    I have a few dozen pdfs that I would like to convert to excel to make the data more easily searchable and sortable. Is it possible I could get a trial to convert one of the files to see how it works before purchasing a whole year? Frankly, I have my

  • Script executing problem

    Hello! I have a great problem. When I for example try to delete records in SQLPlus Worksheet everything is OK, but when I load DBA Studio, I see that "deleted" records are still in the table! Please, help. Chief