Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

include page(file) using URL  RSS feed

 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Is there a way to include a page using URL (full path)?
Like

if(isTeacher())
include("http://domain.com/app/teacher_page.jsp");
else
include("http://domain.com/app/student_page.jsp");

I tried to use <jsp:include .. and <%@include file ..., but I think it doesn't accept URL, only accepts relative path.
This is very bad, because I have to make relative paths for each page.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
forget! this is not necessary.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leandro Coutinho wrote:This is very bad, because I have to make relative paths for each page.

Are the files you wish to include within the same web app? If so, you should be using context-relative URLs.

Using full URLs for files in the same app would be very bad form indeed!
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

But if you want to use include live URL then there is only one way using JSTL <c:import ........ />


Using this you can....

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!