aspose file tools*
The moose likes JSP and the fly likes other webserver page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "other webserver page" Watch "other webserver page" New topic
Author

other webserver page

A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi all,
can we include the jsp page which is present in the other webserver.
if i do this what will happen.

cheers,
babu.


Thanks,
www.Admakr.in
Balasubramani Dharmalingam
Ranch Hand

Joined: Dec 06, 2004
Posts: 116
You can use <c:import url=""/> for include the page of other web-application


Balasubramani SD,<br />SCJP 1.4,SCWCD 1.4,SCJP 5.0<br /><a href="http://sd.balasubramani.googlepages.com" target="_blank" rel="nofollow">www.sd.balasubramani.googlepages.com</a>
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi,

what is <c:

cheers
babu.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61657
    
  67

The core library of the JSTL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi,
is it possible to do with out using the JSTL.

cheers,
babu.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by A Babu:
is it possible to do with out using the JSTL.


Yes. You can use <jsp:include page="www.whatever.com/whatever.jsp"> or <%@ include file="www.whatever.com/whatever.jsp" %>
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi,
Yes. You can use <jsp:include page="www.whatever.com/whatever.jsp"> or <%@ include file="www.whatever.com/whatever.jsp" %>


here can we include the source code of the whatever.jsp file.

i have doubt.can do it ?

cheers,
babu.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by A Babu:
here can we include the source code of the whatever.jsp file.


What do you mean by source code of the whatever.jsp file?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Adeel Ansari:


Yes. You can use <jsp:include page="www.whatever.com/whatever.jsp"> or <%@ include file="www.whatever.com/whatever.jsp" %>


These will not work.
Both look for resources within your webapp.

See the entry in the JSP FAQ for more details about how the JSP include directive and action tags work.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114

These will not work.
Both look for resources within your webapp.

See the entry in the JSP FAQ for more details about how the JSP include directive and action tags work.


so how can achive the including the jsp page which is in the other webserver.

cheers,
babu.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by A Babu:


so how can achive the including the jsp page which is in the other webserver.

cheers,
babu.


Write a utility class which retrieves the content of the remote page using HTTPURLConnection. You could put this logic in some custom tag.


Groovy
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

As was mentioned earlier, you could use the JSTL import tag.
Note, this still doesn't give you access to the JSP source of the other page.

Short of using JSTL, there is no simple way of doing this.
You would need to do as the JSTL import tag does and write code that makes a request and parses the results.

Why are you trying to import pages from other applications?
I ask because there might be better alternatives.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Ben Souther:
These will not work.
Both look for resources within your webapp.

See the entry in the JSP FAQ for more details about how the JSP include directive and action tags work.


Thanks buddy. Although, never tried it myself. I thought it might work like relative paths. But now I realize that it wouldn't work and would be completely illogical as well. Truly saying I was tryin to be smart *ss.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: other webserver page