cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <Alfred.Nathan...@swx.com>
Subject RE: HTTP encoding: trouble with '/'
Date Thu, 27 Apr 2006 06:14:12 GMT
I would guess that the difference between the laptop and the server is
a proxy the request is going through to reach the server.

Your are assuming that there is a double-decoding happening in order
to decode %252F first into %2F and then /.  There is only a slim chance
that this is going to work in the general case.

I don't understand that you have problems with slashes.  Are you using
   <map:match pattern="page-heading/*.png">
instead of
   <map:match pattern="page-heading/**.png"> ?

Why not use /page-heading.png?text=Foo+Bar as URL.  In a querystring
only & and # are problematic.

HTH, Alfred.

-----Original Message-----
From: Mark Lundquist [mailto:ml@wrinkledog.com] 
Sent: Donnerstag, 27. April 2006 03:18
To: cocoon-users@apache.org
Subject: HTTP encoding: trouble with '/'

Hello, me droogs...

Maybe someone can help me with this problem... I've got this Cocoon  
site, and the graphic design calls for a big block of text at the top  
of each page, in Gill Sans font with a drop-shadow effect.  OK, fine  
:-)...  I put together a pipeline that renders the text in SVG and then  
rasterizes it to a PNG using Batik... no big deal.  The text is taken  
right from the the URI, e.g.

	/page-heading/Foo%20Bar.png

replies with a PNG image with the text "Foo Bar" rendered as described.

Of course, the first batch of real-world content showed me the flaw in  
my approach... any "special" characters in the text would come out  
funny, and if the text contained URI metacharacters like '?', then it  
totally botched.  OK, I'm using Saxon so I can call Java directly from  
XSLT.  URLEncoder/URLDecoder to the rescue...

But not quite.  Of course, in one of the real-world pages, the text has  
a "/".  For some reason that I don't understand (being a Bear of Very  
Little Brain), running the "/" through URLEncoder gives "%25", but  
taking that back through URLDecoder does not get me my '/' back... I  
forget what it did, but whatever it was, it didn't work.  Somehow - I  
forget just how - I figured out that what I needed to get the '/' was  
"%252F".  So by this time, I've got the following in my XSLT:

     <img src="/page-heading/{replace (URLEncoder:encode (upper-case  
($text)), '%2F', '%252F')}.png"/>

Now we come to the goofy part... that is, er - the _really_ goofy part  
:-/

I have this site built in two places: (1) on my laptop, and (2) on my  
client's server.  The lash-up described above works fine on my laptop,  
but on the server, it's different!  On the server, I request this:

	http://dev.dragonfly.wd-2.net/page-heading/ 
PRIVACY+%252F+TERMS+OF+USE.png

and I get this:

	The requested resource "/page-heading/PRIVACY+%2F+TERMS+OF+USE.png"  
could not be found

Note, the first byte of the two-byte sequence gets eaten somehow.  But  
on my laptop, the exact same request works fine!  I've looked at it  
with _both eyes_... the squinty one, and the _really_ squinty one :-),  
and it's the same request and it works on one machine and not the  
other!  Both running OS X 10.3.something, both running the same JVM,  
and the Cocoon (2.1.8) build identical on both machines!

I'm out of ideas... anybody have any suggestions?

thx,
-ml-


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message