What environments support dependency injection?

Can someone clarify where dependency injectionlike @PeristenceUnit will, and will not be acted on?I've tried it, for example, in a ServletFilter under Tomcat and Glassfish, and don't seem to get anything.Is it just EJB containers that pick these annotations up?
[284 byte] By [malcolmmca] at [2007-11-26 18:48:56]
# 1

The exact list of classes that are required to support Java EE 5 environment annotations

is defined in Table EE.5-1 of the Java EE 5 specification.

http://www.jcp.org/en/jsr/detail?id=244

Servlet filters are required to

support such annotations.One thing you should check is the version number of the

schema in your web.xml.It must reference the Java EE 5 web-app .xsd version. Otherwise,

annotations are not processed in the web app.Here's an example :

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http

://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/x

ml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

ksaksa at 2007-7-9 6:22:57 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thank's I think I'd better print that document.Does this mean that it won't work with web-app version 2.4? (The default that netbeans set up for me)?
malcolmmca at 2007-7-9 6:22:57 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Right, you'll need 2.5. There was a lot of concern during the specification process aboutthe overhead of searching for annotations on legacy (J2EE 1.4 and earlier) applications. --ken
ksaksa at 2007-7-9 6:22:57 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
It might have been a good idea to have some annotation at the class level for injectable classes. As it is both the methods and fields tables will have to be search sequentially.
malcolmmca at 2007-7-9 6:22:57 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...