jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: Programmatic API for session-timeout

From: Mark Thomas <markt_at_apache.org>
Date: Wed, 25 Jan 2017 09:35:24 +0000

On 24/01/2017 06:04, Shing Wai Chan wrote:
>
>> On Jan 23, 2017, at 5:17 PM, Shing Wai Chan <shing.wai.chan_at_oracle.com> wrote:
>>
>> I am looking at the issue [1] of missing programmatic configuration API for <session-timeout>.
>> Under <session-config>, we have <session-timeout>, <cookie-config>, <tracking-mode>.
>> The other two are configurable from programmatic API.
>> So I suggest to add the following two API in ServletContext
>
> The following are some clarifications:
> The sessionTimeout below are in minutes.
>
>> public int getSessionTimeout();
>>
>> public void setSessionTimeout(int sessionTimeout);
>
> The #setSessionTimeout method can only be called before the ServletContext is initialized.
> It throws IllegalStateException - if this ServletContext has already been initialized

+1

>> In [1], it also mentioned the missing of programmatic API for <distributable>. I do not plan to add API for this unless there are interesting use cases.

I'm not aware of specific requests for setDistributable(boolean) but
given we provide the other setters it seems odd to exclude this one just
because we can't think of a use case.

If it was going to be a lot of effort to implement then I would agree it
makes sense not to add it but the implementation should be trivial.

I think we should add programmatic API for <distributable>.

Mark


>>
>> Please let me know your comments.
>> Thanks.
>>
>> Shing Wai Chan
>>
>> [1] https://java.net/jira/browse/SERVLET_SPEC-70
>>
>