Include jsp from different server


Web tier: servlets, JSP, Web frameworks: Include jsp from different server

  1. Include jsp from different server (5 messages)

    Hi Guys,
    I need to include the to pages in my jsp, both are comming from differet server.
    I am trying like
    < % @include file="" % >
    < % @include file="" % >
    it gives
    nested TokenStreamException: antlr.TokenStreamException: Could not include

    and when I am trying
    ServletContext sc = pageContext.getServletContext();
    RequestDispatcher rd = sc.getRequestDispatcher("");

    it throws NullPioterException as "sc" is null

    Do you know how to include the page from the different server( different servletContext).
    if yes.. pls help me out..

    Thanx in advance

    Threaded Messages (5)

  2. Include jsp from different server[ Go to top ]

    The RequestDispatcher and <%@ include%> only work for resources w/in the same app.

    You could write your own custom tag that opens a UrlConnection to the specified url, grabs the contents and inserts it into your page.


    <%@taglib uri="/WEB-INF/custom.tld" prefix="include" %>
    <include:page url=""/>
  3. Include jsp from different server[ Go to top ]

    Hi ,

    Thats right I can create the tag lib for this.... If you already created tag lib for this then please give me the sample code.

    I don't have any problem in using ServletContext or RequestDespatcher inside the JSP.....

    I need to include to different pages comming from different server.

    if you have the solution in any form (jsp / servlet / taglib ) please send the sample code.


  4. Include jsp from different server[ Go to top ]

    I have not written one. One thing to watch out for if you do write one:

    If the page your including has any relative urls in it (images, links, scripts, etc...), they wont load/work. Any of these must be fully qualified for it to work.
  5. Include jsp from different server[ Go to top ]

    Hi all,
    I wonder if there is any limitation to the number of connections that are opened by one jvm. If the loaded pages were slow I quess an increase in the number of connections may become a problem. Also trying to download pages from an appserver and including it into our jsp may cause also bad performance issues.

    Am I right at these points?
  6. Include jsp from different server[ Go to top ]

    There are. Sockets are limited resources in JVM. The number of connections a JVM can handle is dependant on the underlying OS.