Hi Guys,
I need to include the to pages in my jsp, both are comming from differet server.
I am trying like
< % @include file="http://www.abc.com/example1.jsp" % >
< % @include file="http://www.xyz.com/example2.jsp" % >
it gives
nested TokenStreamException: antlr.TokenStreamException: Could not include http://www.abc.com/example1.jsp
and when I am trying
ServletContext sc = pageContext.getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("http://www.abc.com/example1.jsp");
rd.include(request,response);
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
Prakash
-
Include jsp from different server (5 messages)
- Posted by: prakash dewangan
- Posted on: December 10 2002 06:19 EST
Threaded Messages (5)
- Include jsp from different server by Web Master on December 10 2002 07:48 EST
- Include jsp from different server by prakash dewangan on December 10 2002 09:31 EST
-
Include jsp from different server by Web Master on December 10 2002 10:03 EST
-
Include jsp from different server by Burak AKSOY on December 11 2002 01:35 EST
- Include jsp from different server by Oon Kean Lin on December 18 2002 12:08 EST
-
Include jsp from different server by Burak AKSOY on December 11 2002 01:35 EST
-
Include jsp from different server by Web Master on December 10 2002 10:03 EST
- Include jsp from different server by prakash dewangan on December 10 2002 09:31 EST
-
Include jsp from different server[ Go to top ]
- Posted by: Web Master
- Posted on: December 10 2002 07:48 EST
- in response to prakash dewangan
The RequestDispatcher and <%@ include%> only work for resources w/in the same context...ie..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.
ex:
<%@taglib uri="/WEB-INF/custom.tld" prefix="include" %>
<include:page url="http://www.abc.com/example1.jsp"/> -
Include jsp from different server[ Go to top ]
- Posted by: prakash dewangan
- Posted on: December 10 2002 09:31 EST
- in response to Web Master
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.
thanx
prakash -
Include jsp from different server[ Go to top ]
- Posted by: Web Master
- Posted on: December 10 2002 10:03 EST
- in response to prakash dewangan
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. -
Include jsp from different server[ Go to top ]
- Posted by: Burak AKSOY
- Posted on: December 11 2002 01:35 EST
- in response to Web Master
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? -
Include jsp from different server[ Go to top ]
- Posted by: Oon Kean Lin
- Posted on: December 18 2002 00:08 EST
- in response to Burak AKSOY
There are. Sockets are limited resources in JVM. The number of connections a JVM can handle is dependant on the underlying OS.