[opencms-dev] JSessionID in request

Thomas Göttlich guo.tuomi at googlemail.com
Tue Dec 13 19:00:14 CET 2011


Hi,

we have a system that frequently queries OpenCMS for content (which is
delivered as JSON).
Thus we use java.net.URL, open a connection and read the response from
OpenCMS.

This works fine but we observed that for each request a new http session
object is created.
In order to prevent this, we'd like to reuse the session and thus we
extract the JSESSIONID from the response header and on subsequent requests
we set it as a request property.

However, OpenCMS tries to get its own session associated with that
JSESSIONID and fails, since it is a 33-character string as opposed to the
36-character string that is required by CmsUUID (actually the internally
used UUID).
We thus get this exception: java.lang.NumberFormatException: UUID has to be
represented by the standard 36-char representation

I could change the JSESSIONID to be 36-characters long but it still isn't a
valid UUID (which has to contain dashes).

Does anyone know how we can reuse the same http and OpenCMS sessions for
internal requests made by our system?

Thanks in advance.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20111213/681cdce2/attachment.htm>


More information about the opencms-dev mailing list