Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:import

 
Raymond Sabbatini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be a thread dealing with this somewhere... so apologies if there is (i'm a greehorn on this site)
I'm trying to find out the following: if I use jsp:import to incorporate a web page (using an absolute URL) within my web page, then if a user clicks on a link on the imported web page, is it possible to get hold of the the SRC value (as a parameter) so that instead of returning just the URL referenced web page, I will be able to display, in the user's browser, the page they want, but with my web page 'including' it. In other words, I would like to have a series of my own web pages, which all include external content, but without allowing the user to simply load the external source and ignore my content.
I hope this is clear(!).
I may be missing some easier way to do this, so that's another reason for asking. I mean it may be that I need to use ASP or PHP...
I could, of course, use frames, but that is something I am, at this stage trying to avoid.
Also, I am lead to understand that even ignoring the problem of user clicked links (above), that jsp:import only works for text in external content, not images. I haven't even begun to think whether any of this would work for complex external sources, such as forms, login on, searches etc.
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the include it just grabs the referenced file and includes it in your JSP which then gets passed on to the user, you can't intercept their links that way AFAIK. You would have to use something else to grab the page, then parse the source changing all the hrefs to point to your site with the external sites url as a parameter or something. If their site uses relative image locations then that would be a problem for you because the client would then request the images off your server. if the images used absolute addressing it would be OK.
A simpler way would be to use an iframe, where the external links would change the site shown within the iframe and not affect your surrounding site.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic