Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

other webserver page

 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • 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.
 
Balasubramani Dharmalingam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
hi,

what is <c:

cheers
babu.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The core library of the JSTL.
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
is it possible to do with out using the JSTL.

cheers,
babu.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic