Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[rest-dev] Deprecating @Context and Supporting CDI

Hello All,

The deadline for a proposal for Jakarta EE 12 is coming up quickly, April 15th 2025. The EPIC for Jakarta REST 5.0 is https://github.com/jakartaee/rest/issues/1158.

I'd like to propose we make an attempt to resolve the issue of deprecating @Context and supporting CDI.

We currently have the following issues associated with this:


The first step seems to be consolidating these.

My proposal is that we add @Deprecated(forRemoval = true) to the @Context annotation. We should probably also deprecate the ContextResolver as that can be replaced by a CDI producer.

For the client, I think we should just be explicit in the specification that if a client is running within a CDI container, that CDI will be supported. If it's outside a CDI container, it will not be. The question there becomes, how do we support injection for resources which @Context injection previously worked on. We could just say, it no longer supports it and you need to boot a CDI container if you want that. Or, potentially, there is a way to say we support Jakarta Injection and allow @Inject to effectively replace @Context.

What do you all think? In my opinion it feels critical to get this moving for Jakarta EE 12.


James R. Perkins

Principal Software Engineer

Red Hat


Back to the top