cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: SendMailTransformer session issue
Date Tue, 03 Aug 2004 18:42:24 GMT
Rui Alberto L. Gonçalves wrote:
> I all,
> I need to use SendMailTransformer to send the user the 
> current page that he/she is viewing.
> To do this, I'm doing:
> <email:sendmail>
>  ...
> <email:attachment name="Your page"
>                   mime-type="text/html"
>                   src="cocoon:/display_user_page"/> ...
> </email:sendmail>
> I'm using cookies to identify the user session, and the 
> target cocoon:/display_user_page uses user session values.
> It looks like SendMailTransformer ignores this and just 
> performs an http request as another new different client! 
> (JSESSION id cookie is not sent)
> Does anyone would like to suggest an approach to this problem?
> Thanks for any help.
> Rui
I have currently no solution for this, but I can try to 
explain what is happening:

Usually, the cocoon protocol is resolved internally which means
if you use it, the request is handled internally and no new
http request is send. Of course, an internal request runs in
the same session as the original one.

Unfortunately, the cocoon protocol delivers by design XML, to
be more precise the XML send by the last transformer before
it is feed into the serializer.
Therefore if you want to create a PDF attachment, using the
cocoon protocol would simply fail. You wouldn't get PDF
but XSL:FO which is not what you want :(

Therefore the sendmail transformer "rewrites" the internal
cocoon protocol to an external one in order to run the correct
serializer at the end.

I think it is possible to append the session id or to add 
a cookie to the request, but it is not the same client! It is
the server that acts now as the client. If your servlet engine
verifies this, it won't work even if you would append 
the information.

Now, a possible solution would be to either extend or create
a new protocol that works the same way as the cocoon protocol
but doesn't always deliver XML. It would use the correct
serializer at the end and offer a byte stream instead of sax


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message