jakartaee / jakartaee/servlet

Specify how CDI defined scopes should behave for Servlet (in a new section)

Open
#1,027 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
325
Forks
112
PR merge metrics
No merged PRs in 30d

Description

Historically, the CDI specification defined how CDI scopes such as the RequestScope and the SessionScope had to behave for Servlets.

In CDI 4.1 this specification text was pushed out (see https://jakarta.ee/specifications/cdi/4.1/ "Delegate integration requirements to the Jakarta Platform specifications"), following CDI's stated goal of being a foundational bean model and not a framework or facade building or augmenting other specs.

In EE 11 we were running out of time and the, more or less orphaned, spec text was put in the platform specification (see e.g. https://jakarta.ee/specifications/platform/11/jakarta-platform-spec-11.0#builtin_contexts_ee), but it's not seen as its proper home (see https://github.com/jakartaee/platform/pull/1246#issuecomment-4142614437)

I'd like to propose adding a new section, 15.6, to define the behaviour for the CDI build-in contexts for Servlet.

The section would start much like the other sections in 15 already do.

E.g. as a draft, based on the existig spec that was moved from CDI:

_"In a product that supports Contexts and Dependency Injection (CDI) for Jakarta EE Platform, and in which CDI is enabled for the web application, the container MUST support the CDI built-in request, session, and application contexts during servlet processing as defined in this section.

The request context is active:

during the service() method of any servlet in the web application, during the doFilter() method of any servlet filter and when the container calls any ServletRequestListener or AsyncListener

[...]"_

Alternatively, we could also fold 15.5.16 into a new section and more generally call it "Contexts and Dependency Injection":

* 15.6 Contexts and Dependency Injection
* 15.6.1 General CDI requirements
Move current 15.5.16 here.
* 15.6.2 Built-in CDI contexts during servlet processing
* 15.6.2.1 Request context lifecycle
* 15.6.2.2 Session context lifecycle
* 15.6.2.3 Application context lifecycle

Contributor guide

Open the contributing guide

Research direction

Start by comparing the CDI 4.1 text referenced in the issue with the Jakarta Platform 11 section on built-in contexts and current Servlet specification section 15.5.16. Review the proposed section structure and lifecycle requirements, then resolve which material belongs in Servlet. Done means an agreed, consistent specification section covering CDI request, session, and application contexts during servlet processing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.