struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <>
Subject Re: Struts / JSTL c:import external websites
Date Tue, 03 May 2005 16:48:48 GMT
On 5/3/05, Folashade Adeyosoye <> wrote:
> Hi all,
>    This might be a JSTL question more than a struts question, but I think
> developers might have run into this problem before while developing in
> Struts..
> I was able to import my Yahoo forum into my portal like application, but the
> all the links are relative to my site rather than the yahoo site, any hints
> to get this to work.
> <c:import  url=""/>
> It shows up fine but the links defaults to my site.

Actually, it's not even a JSTL question ... it's an issue of how HTML works.

The <c:import> tag, when you give it a URL, just includes the contents
returned by that URL into the current page, with no modifications.  If
the content includes relative links, they are going to be interpreted
as relative to *your* page (as you observed), unless you:

* Suck the contents into a buffer and physically modify all the
  links yourself before outputting it.

* Use a <base> element in your <head> section that points at
  the Yahoo page (but this will mess up any relative links you
  have in your content)

* Use frames so that the Yahoo page is loaded separately, and
  relative links will work as expected.


> .
> Shardayyy

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message