You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Holden Robbins <ho...@cparity.com> on 2002/06/13 04:14:18 UTC

Generating XML with URLs that use Sessions

Hi, 

I've recently come across a major stumbling block in converting my servlet
based site to use Cocoon.  I'm hoping to use cocoon instead of having each
individual servlet having the XSL transformations hard coded and doing it
themselves. 

The problem is that the servlets use session variables and the JSessionId
cookie is lost when the URL of the servlet is called through cocoon file
generator. 

  0                    /---\           /---\
 /|\   JSessionID      |   |  nada     |   |
  |    --------->      |   |  ------>  |   |
 / \                   \---/           \---/

Client                 Cocoon         Servlets
                    File Generator


I don't see any way to set headers or get headers from cocoon generators. 
Which means I can't grab the JSessionId from the header in the response
returned by the servlet and I can't set the JSessionId in the header for
the request to the servlet. 

Is there an easy solution to this problem that I'm missing?  

My only choice seem to be re-write each of the servlets as a cocoon
generator which I'm not sure I want to do. 

Thanks,
-Holden


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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Generating XML with URLs that use Sessions

Posted by Vadim Gritsenko <va...@verizon.net>.


Vadim

--
Resistance is futile. 

> -----Original Message-----
> From: Holden Robbins [mailto:holden@cparity.com]
> Sent: Wednesday, June 12, 2002 10:14 PM
> To: cocoon-users@xml.apache.org
> Subject: Generating XML with URLs that use Sessions
> 
> 
> Hi,
> 
> I've recently come across a major stumbling block in converting my
servlet
> based site to use Cocoon.  I'm hoping to use cocoon instead of having
each
> individual servlet having the XSL transformations hard coded and doing
it
> themselves.
> 
> The problem is that the servlets use session variables and the
JSessionId
> cookie is lost when the URL of the servlet is called through cocoon
file
> generator.
> 
>   0                    /---\           /---\
>  /|\   JSessionID      |   |  nada     |   |
>   |    --------->      |   |  ------>  |   |
>  / \                   \---/           \---/
> 
> Client                 Cocoon         Servlets
>                     File Generator
> 
> 
> I don't see any way to set headers or get headers from cocoon
generators.
> Which means I can't grab the JSessionId from the header in the
response
> returned by the servlet and I can't set the JSessionId in the header
for
> the request to the servlet.
> 
> Is there an easy solution to this problem that I'm missing?

1. Have your servlets deployed together with Cocoon in one webapp

2.
...
<map:act type="get-session-id">
  <map:generate
src="http://host:port/cocoon/old-servlet;jsessionid={session-id}"/>
</map:act>
...

should work.


Vadim


> 
> My only choice seem to be re-write each of the servlets as a cocoon
> generator which I'm not sure I want to do.
> 
> Thanks,
> -Holden
> 


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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>