You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thierry BARUSTA <tb...@cvf.fr> on 2004/09/14 13:59:24 UTC

Desperate Cocoon user would like to have {response:status} (eg)?

Hello!

I've posted few questions around this subject but no anwsers... yet.

As the request input module, I'd like to have a response input module,
thanks to which I could access easily reponse data from the sitemap as
{request:contextPath}. I'm out of ideas trying to:
-get http response information
-in case it's a redirect (code) forward it to client with the right
location header

Thanks,
Thierry 


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


Re: Desperate Cocoon user would like to have {response:status} (eg)?

Posted by Sylvain Wallez <sy...@apache.org>.
Thierry BARUSTA wrote:

>Hello!
>
>I've posted few questions around this subject but no anwsers... yet.
>
>As the request input module, I'd like to have a response input module,
>thanks to which I could access easily reponse data from the sitemap as
>{request:contextPath}. I'm out of ideas trying to:
>-get http response information
>-in case it's a redirect (code) forward it to client with the right
>location header
>  
>

Going back to your original question (i.e. propagating redirects from a 
proxied server to the client), output modules won't solve the problem: 
the sitemap expressions are resolved during sitemap execution, which 
happens *before* pipeline execution, i.e. before the ProxyGenerator 
sends the request to the proxied server.

The only way to achieve what you want is to have an action perform the 
http request on the remote server, propagate the redirect  (using the 
redirector object) if one has been sent or store the http response 
stream as a request attribute for later use of its content by a 
generator (a simple parser).

Hope this helps,
Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


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


Re: Desperate Cocoon user would like to have {response:status} (eg)?

Posted by Jorg Heymans <jh...@domek.be>.
I don't understand what you are trying to do. You want the http response 
headers that cocoon is sending to the client? Elaborate your usecase a 
bit so we can help you.

Regards
Jogr

Thierry BARUSTA wrote:

> Hello!
> 
> I've posted few questions around this subject but no anwsers... yet.
> 
> As the request input module, I'd like to have a response input module,
> thanks to which I could access easily reponse data from the sitemap as
> {request:contextPath}. I'm out of ideas trying to:
> -get http response information
> -in case it's a redirect (code) forward it to client with the right
> location header
> 
> Thanks,
> Thierry 


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


Re: Desperate Cocoon user would like to have {response:status} (eg)?

Posted by Jorg Heymans <jh...@domek.be>.
Forwarding this back to the list Thierry.

If the webserviceproxygenerator does not provided you with the response 
data, then you should eiter add it or write a custom generator based 
upon HTTPClient. You could then just insert a <response> node or add a 
response object as a requestattribute.

Does this make sense or am I still  not getting what you want?

rgds
Jorg

-------------------------------------------
Thierry BARUSTA wrote:


We've got a distant server providing us with xml pages. To retrive these
pages we use the wsproxy generator, we transform the pages (rewrite the
links so that it will use our proxy) and serialize them and it works
fine.
But, when the xml server sends a redirect (302), as it is taken care of
by the Httpclient, it's hidden for the client side and therefore when we
rewrite the links, all the request:contextPath, request:requestURI are
referencing the first initial query. Which means that the link rewriting
function can't access the actual data after redirection.
We can hack the code WebServiceroxyGenerator by setting
setFollowRedirects to false... and then? How can I access the
information about the response? I've had a look at flows and XSP to
aquire these data and be able to use <map:redirect-to uri="the
path_gotten_from_the_response_and_transformed_so_that_the_browser_
will_do_a_get_against_our_webapp"
Since now I didn't find out how to do that...

Hope it's clearer.

Thank you very much in advance,

Regards,

Thierry BARUSTA wrote:
> Hello!
> 
> I've posted few questions around this subject but no anwsers... yet.
> 
> As the request input module, I'd like to have a response input module,
> thanks to which I could access easily reponse data from the sitemap as
> {request:contextPath}. I'm out of ideas trying to:
> -get http response information
> -in case it's a redirect (code) forward it to client with the right
> location header
> 
> Thanks,
> Thierry 


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