tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Kindler" <kindl...@arcor.de>
Subject AW: relative paths and c:import
Date Wed, 23 Nov 2005 09:30:57 GMT
> -----Urspr√ľngliche Nachricht-----
> Von: erh@swapsimple.com [mailto:erh@swapsimple.com] 
> Gesendet: Dienstag, 22. November 2005 21:07
> An: Tag Libraries Users List; kindlerm@acm.org
> Betreff: Re: relative paths and c:import
> On Tue, Nov 22, 2005 at 06:38:34PM +0100, Martin Kindler wrote:
> > Isn't there another solution? I do control both servers but 
> forcing to 
> > use absolute URLs via a CMS would be a problem. I can 
> imagine witing 
> > sort of a wrapper to adapt the result of c:import, but this 
> must be a 
> > common problem. So I hope someone has already done the job?
> 
> You could try to write a bunch of regex's to do things like  
> s/<img src="...">/<img src="http:...">/ (good luck.  let me 
> know which insane asylum you check into.)

That's the solution I thought of. And I don't think it is too complex
as long as I only deal with <img> and <a> relative paths which are directly
coded
in HTML (I can make this restriction in my case). That means no Javascript
and no CSS. The general case (even without JS/CSS) is a bit harder.


> Depending on the structure of your site, you could also try 
> putting the CMS servers content in an iframe.  Of course, 
> that completely sidesteps the whole issue since your jsp 
> won't actually be doing the import anymore, so it doesn't 
> work if you fiddling with the data in any way.

I never thought of iframes because I believed them to be supported by only
IE.
But after looking into the spec I see they are now "officially" supported.
This might be the easier way for me.

> 
> Why is using absolute URLs a problem?  It's really the _only_ 
> way to refer to content that's on a different server.

Simply because the CMS will use relative URLs. Maybe it can be configured to
use
relative paths, but I don't know (well, I know, it is possible, but do not
know how
much effort would be needed).
The other point is that the c:import tag has all the information to expand
relative tasks. 
It could implement the general solution from above (well JS/CSS might be
hard, and giving the
user enough control of the process to be generally useful (do I want
background images or not?)
might be forbidding)

> If you are actually processing the data from the CMS server 
> in your jsp page the best way to fix it would probably be to 
> have the jsp page entirely parse 
> out the imported content and regenerate it.  Of course, 
> that's going to be a bit more work, and you'll probably want 
> to communicate using xml instead of an arbitrary web page 
> from the CMS web server.


Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message