users@servlet-spec.java.net

[servlet-spec users] Re: session(-less) applications

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Thu, 27 Nov 2014 09:38:23 +0100

Hi,

On Thu, Nov 27, 2014 at 4:30 AM, Stuart Douglas <sdouglas_at_redhat.com> wrote:
> I'm still not sure what the actual use case for this is, I assume it is an
> app with some 3rd party code calls getSession(true)?

We used our own code for this in the past to indeed work around 3rd
party code. This can be container code as well, for instance in the
2.0 timeframe, Mojarra always created sessions automatically to store
some encoding info.

A global "no sessions switch" can also be used as a development time
facility to help pinpoint which code is creating sessions and where.

As such the facility is not entirely unlike a feature we recently
introduced in OmniFaces; the NoAutoGeneratedIdViewHandler (
http://showcase.omnifaces.org/viewhandlers/NoAutoGeneratedIdViewHandler),
which throws an exception as soon as JSF auto-generates an ID
somewhere. This is very useful to pinpoint during development and QA
where components without explicit IDs are used. It's assumed to be
turned off in production.

So the options for such a switch could be:

* Throw exception
* Create session for 1 request

Kind regards,
Arjan



> If this is the case I
> don't really like the idea of adding session less applications to the spec
> just to work around it.
>
> Stuart
>
>>
>> cheers
>>
>>
>>
>> --
>> Greg Wilkins <gregw_at_intalio.com> @ Webtide - *an Intalio subsidiary*
>> http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
>> http://www.webtide.com advice and support for jetty and cometd.
>>