Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rest-dev] CDI Integration and the @Context annotation
  • From: James Perkins <jperkins@xxxxxxx>
  • Date: Fri, 9 Oct 2026 18:42:10 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ibm.com; dmarc=pass action=none header.from=ibm.com; dkim=pass header.d=ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cm6QwHcpnrHotd/32VoIo67+SYCWCiQy+P7Z6aFzJ3Y=; b=k0vureqSmH95O+rb5R/lLPj1Bp3P2VZRLBlYqT9bjCUAo7X6gS+OYwaO+Nrib2sUihNMY1+RYf66yrWGd4/GkvY6dZTLZlwAI0vcwP8N76xGDtrWV5aabCn6csYO+iQrq6/U6cJYIWqnGSPRRmqba50AwOPldqHnTqaJdR5lKFlK+WUv5cqt1PxK+oQOeJjC4k8CGAIrdAV5i5PgGlCwtT2ICA2dDM/QZpLE1GiTqSF11qAkd3t7yL7OcGf5ywkNUMf7918yc6ncd9SHAxzeHO/fNKZbwMhlYzH6MRw7dDwcf8xAp4L803X3sZIPdWnR/ent+oZGVgZP11nGkKpIcg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kuS9U24etEd8MtuKmPC8ARQ6Gr+pflClO3qRaFHj0sJkZVtyp9/w64nv8PYt0+VTifig11md1PsIFtCatdNp4lfqdtUg8NoIoOyUWVIaXOY2Wjn/P4uSW7Rt0jVntryCpWpH/FRRtU7d84rjrpivhsIMq2dOKxPKkEpB01rRE+N+9LXMGdexO4tMJU4GzpYFCPyV/xz6GCF89vzYkSxUi1vdsiKtnETBeTmuomZ0tv6L+58CpDObAvuz36sihwtlz+bayGHveMYfhpM+7ouBCq45lDffO6NU1exAfYs+te41f+7rLM9w/krMdzHQIaQacYHpY3I2WO49G1xV5SMX5w==
  • Delivered-to: rest-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/rest-dev/>
  • List-help: <mailto:rest-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/rest-dev>, <mailto:rest-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/rest-dev>, <mailto:rest-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels:
  • Thread-index: AQHdWAxdSjReQx78aU6ZAq7+qlJ7v7b1f/YAgAALIhg=
  • Thread-topic: [EXTERNAL] Re: [rest-dev] CDI Integration and the @Context annotation

Excellent. I'll do some experimenting with it, but I think it will be the best path forward. Let's see if anyone from Jersey has an opinion too.

In RESTEasy what I've done is just explicitly added @Inject to any member with a @Context and it seems to be working. I'm working through some implementation issues, but nothing too bad yet.

James R. Perkins
Software Developer 

IBM

From: rest-dev <rest-dev-bounces@xxxxxxxxxxx> on behalf of Markus KARG via rest-dev <rest-dev@xxxxxxxxxxx>
Sent: Friday, October 9, 2026 11:00
To: James Perkins via rest-dev <rest-dev@xxxxxxxxxxx>
Cc: Markus KARG <markus@xxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: [rest-dev] CDI Integration and the @Context annotation
 
I am not a CDI expert. If it is possible to keep @Context and make it a CDI qualifier without running into a lot of side-effects aka troubles, I would say let's do that. In the end it makes migration easier for users if they CAN switch to @Inject

I am not a CDI expert. If it is possible to keep @Context and make it a CDI qualifier without running into a lot of side-effects aka troubles, I would say let's do that. In the end it makes migration easier for users if they CAN switch to @Inject but are not FORCED to do that. My intention when originally asking to get rid of @Context was that I actually wanted to get rid of the separate injection framework implied. If @Context can stay in the boat while still getting rid of that separate framework, I'm all in.

-Markus


Am 09.10.2026 um 18:58 schrieb James Perkins via rest-dev:
Hello All,
This week I've been working on integrating Jakarta REST 5.0 CDI integration into RESTEasy. I've found a couple minor issues we'll need to address in the spec. However, I'd first like to talk about @Context. We deprecated that annotation, but now I'm wondering if we should instead make not deprecate it and make it a CDI qualifier. The biggest reason for this would be we do need some kind of a qualifier to inject the `ServletConfig` and `ServletContext`. If we don't have a qualifier, then there is a chance we get the wrong instance injected. Making the `@Context` a CDI qualifier would allow the implementation and user to know they're getting the correct instances injected.

The other two issues are more minor and just documentation changes I hadn't thought about until I fully implemented some things. I'll send up a PR those and for making the @Context a CDI qualifier, but that will be a separate commit in case others disagree. It will make it easier to delete.

James R. Perkins
Software Developer 

IBM

_______________________________________________
rest-dev mailing list
rest-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://accounts.eclipse.org

Back to the top