-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David,
On 3/8/12 2:33 PM, David Wahler wrote: > On Thu, Mar 8, 2012 at 12:58 PM, Caldarale, Charles R > <[email protected]> wrote: >>> From: David Wahler [mailto:[email protected]] Subject: Tomcat >>> 5.5 JDK version compatibility >> >>> Does this mean that if a web application is deployed in Tomcat >>> 5.5, it may not use any language features that were introduced >>> in J2SE 5.0 or later (e.g. annotations and generics), even if >>> those features are supported by the JRE? >> >> It's not the JRE that's the issue, it's the servlet spec version >> that your webapp is claiming compliance with. Annotations don't >> appear there until 2.5 (if I remember correctly). Generics will >> likely work, because there's nothing in the servlet spec related >> to those. > > True, neither annotations nor generics are mentioned in the > servlet 2.4 spec, but both are supported at the language level by > JRE/JDK 5 and up. In particular, my test case refers to > @javax.annotation.Resource, which is part of J2SE 6 and understood > by dependency-injection frameworks like Spring and Guice. But as > per Servlet 2.5, that annotation is also interpreted by Tomcat 7 > and used to inject JNDI dependencies. My expectation was that > Tomcat's annotation processing would only happen if web.xml > referred to version 2.5 of the spec or later. > > Hence the question: does the fact that annotations are a Java 5 > feature automatically make a webapp that uses them non-compliant > with servlet spec 2.4? > > (Mark seems to be assuming that I compiled my test case against > Tomcat 7 APIs and then tried to deploy the resulting app with > Tomcat 5.5, which isn't the case.) Without further specifics, I would agree with you: if your webapp says it's 2.4-spec, then no annotation processing should occur (at least by Tomcat: Spring, etc. is free to process annotations). - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9ZEggACgkQ9CaO5/Lv0PCNagCfRwlwZtaNfCTVo9IbYZfhouCy HyUAn22/b5YgHey6hwWBpZvb0DKBWKpx =FgjU -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
