Richard Lewis wrote:
Hello Cocooners,

I am implementing a search engine for my Cocoon site as a Java servlet.
All Cocoon has to do is send the search terms from an HTML form to the
servlet and then send the results through a stylesheet:

<map:match type="request-parameter" pattern="search">
    <map:generate
    src="http://localhost/search?terms={raw-request-param:search}"; />
    ......
</map:match>

It works, except when the request parameter 'search' has a space in it,
it is passed on as "term1 term2" where it should be "term1+term2". This
causes the sitemap to break because there is a space in the map:generate
src URI above.

Does anyone know whats wrong with this?
raw request parameter module does not work and will not work due to the servlet specs. You should nest two input modules to make it work: request parameter module and url encode module.

Example:

<map:match pattern="remote-action">
<map:generate src="{global:skid-url}?LIC_ID={url-encode:{session-attr:userid}}&amp;KH_KOD={url-encode:{request-param:contractor-code}}"/>
<map:serialize/>
</map:match>



-- Leszek Gawron [EMAIL PROTECTED] Project Manager MobileBox sp. z o.o. +48 (61) 855 06 67 http://www.mobilebox.pl mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65

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



Reply via email to