I have solved the problem by creating a custom generator based on
ProxyGenerator.java (from Lenya). The generator copies parameters and
headers from the original request to the proxy request, then it copies
cookies and headers back to the response.

This seems to work, with the exception that at least in Forrest, the
ResponseWrapper object passed to the generator via the objectModel map
does not allow modification of response headers and unlike
HttpResponse does not have the setStatus() method (sending Form data
via the POST method often results in a 'page temporary moved' and
redirection to another page). I don't know how to solve this problem -
i.e. dynamic redirection from inside an inner body-*, but this is
perhaps more Forrest specific.


Tal Shalif wrote:
> How do I generate (in a sitemap.xmap pipeline) HTML from a remote
> HTTP server passing through the client browser's form parameters using
> the POST method?
>
>
> What I would like to achieve is embed a foreign site (e.g. a PHP based
> trouble ticket system running on Apache server) inside a Forrest/cocoon
> site (please see diagram below). I provide the generator with the
> client form data via the query string:
>
> <map:generate type="html"
>             src="http://localhost/tr/{1}{2}?{request:queryString}";>
>
> But what do I do if the client is sending form data using the POST
> method?
>
>
>
> +---------------+
> | remote:80     |   (remote http)
> +---------------+
>       ||
>       ||
>       \/
> +-----------------------------------+
> | site skinning with forrest/cocoon |  (cocoon/forrest)
> +-----------------------------------+
>       ||
>       ||
>       \/
> +------------------------------------------+
> | User view HTML page and/or submits back  |  (client browser)
> | its form data using the POST method      |
> +------------------------------------------+
>       ||                                /\
>       ||                 ||
>       \/                 ||
> +--------------------------------------------------+
> | Cocoon passes the request   |                    |
> | to remote server also using | Site skinning with | (cocoon/forrest)
> | the POST method             | Cocoon/forres      |
> +--------------------------------------------------+
>
>                   ||                   /\
>            ||                ||
>            \/                ||
>
>                 +-------------------------+
>              | remote HTTP server:80   |   (remote http)
>              +-------------------------+
>
Kaj Kandler <[EMAIL PROTECTED]> wrote:

Hi Tal,
you should be able to use {request-param:your parameter}

<map:generate type="html"
src="http://localhost/tr/{1}{2}?{request-param:first}&{request-param:second}&...";>

This will not do as proxy, since there is no knowledge of the query
parameters available to place in the sitemap. Also, above constructs a
query string, which will not be used if the page is to be retrieved
using the POST method.


K<o>


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

Reply via email to