• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

other webserver page

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
can we include the jsp page which is present in the other webserver.
if i do this what will happen.

cheers,
babu.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use <c:import url=""/> for include the page of other web-application
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

what is <c:

cheers
babu.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The core library of the JSTL.
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
is it possible to do with out using the JSTL.

cheers,
babu.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic