Hi,


I've got problems using <map:redirect-to uri="uri?param=value" />.
It seems that correctly quoted ampersands (%26) within value get
mysteriously unquoted when using RequestMatcher and redirect.

I'm using Cocoon-2.0.2 with Tomcat-4.0.1 on Win32. This has been
verified with IE, Mozilla and Opera.

I've prepared a sitemap to be dropped into cocoon/mount/redirect_debug.
It's attached to this mail.

If you call the pipeline "works" you get the complete parameter value
from the RequestGenerator with the ampersand. If you call the
pipeline "worksnot" the ampersand gets unquoted during the redirect
and the RequestGenerator accordingly cuts off the value.


Speaking sitemap terms ...

This redirect

<map:redirect-to uri="second?param=value%26value" />

produces these parameter

<requestParameters>
  <parameter name="param">
    <value>value&value</value>
  </parameter>
</requestParameters>

while these two redirects

<map:redirect-to uri="second?param=value%26value" />

<map:match pattern="second">
  <map:match type="request" pattern="param">
    <map:redirect-to uri="showreq?param={1}" />
  </map:match>
</map:match>

produce these parameter

<requestParameters>
  <parameter name="param">
    <value>value</value>
  </parameter>
</requestParameters>


Here is a transcript with the important parts, from a TcpMonitor:

Listen Port: 7777
Target Port: 8080
==== Request ====
GET /cocoon/mount/redirect_debug/works HTTP/1.1
==== Response ====
HTTP/1.1 302 Moved Temporarily
Location:
http://localhost:7777/cocoon/mount/redirect_debug/showreq?param=value%26valu
e
==== Request ====
GET /cocoon/mount/redirect_debug/showreq?param=value%26value HTTP/1.1
==== Response ====

HTTP/1.1 200 OK
Content-Type: text/html
X-Cocoon-Version: 2.0.2


So far the correct one. Now the incorrect.


==== Request ====
GET /cocoon/mount/redirect_debug/worksnot HTTP/1.1
==== Response ====
HTTP/1.1 302 Moved Temporarily
Location: http://localhost:7777/cocoon/mount/redirect_debug/first
==== Request ====
GET /cocoon/mount/redirect_debug/first HTTP/1.1
==== Response ====

HTTP/1.1 302 Moved Temporarily
Location:
http://localhost:7777/cocoon/mount/redirect_debug/second?param=value%26value
==== Request ====
GET /cocoon/mount/redirect_debug/second?param=value%26value HTTP/1.1
==== Response ====

HTTP/1.1 302 Moved Temporarily
Location:
http://localhost:7777/cocoon/mount/redirect_debug/showreq?param=value&value
==== Request ====
GET /cocoon/mount/redirect_debug/showreq?param=value&value HTTP/1.1
==== Response ====

HTTP/1.1 200 OK
Content-Type: text/html
X-Cocoon-Version: 2.0.2



As you can see, the redirect after the RequestMatcher unquotes the quoted
ampersand.


I've had a short look into the Cocoon-Sources, but were unable to see
anything (because my knowledge of cocoon internals is limited). Maybe
it's also an Tomcat issue ...



Does anyone got an idea ?



Regards,


Jens

--

jens.lorenz at interface-projects dot de

interface:projects GmbH                             \\|//
Tolkewitzer Strasse 49                              (o o)
01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
Germany

Attachment: sitemap.xmap
Description: Binary data

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to