You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Folashade Adeyosoye <sh...@gmail.com> on 2005/05/03 15:29:47 UTC
Struts / JSTL c:import external websites
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="http://groups.yahoo.com/group/forumName/"/>
It shows up fine but the links defaults to my site.
.
Shardayyy
Re: Struts / JSTL c:import external websites
Posted by Craig McClanahan <cr...@gmail.com>.
On 5/3/05, Folashade Adeyosoye <sh...@gmail.com> 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="http://groups.yahoo.com/group/forumName/"/>
>
> 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.
Craig
> .
>
> Shardayyy
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org