API feedback

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 11 Jul 2007 15:54:19 -0400

Paul and I presented the current API to a group of Sun folks
including specification leads for other technologies in Java EE. We
received some useful feedback that I'd like to share and get your
thoughts on:

- Consider use of @Resource instead of @HttpContext. The @Resource
annotation defined by JSR 250 (part of EE 5) is designed as a generic
solution to the problem that @HttpContext solves. A downside is that
@Resource cannot be used on method parameters so UriInfo, HttpHeaders
and PreconditionEvaluator couldn't be used as parameters as is
currently the case.

- Consider adding a set of static methods to Response for common use
cases. These would defer to the full
method. This is mainly a convenience thing to cut down the amount of
code required to create a common response.

- Resource injection needs to happen in one place. JAX-RS, Servlet,
JSF, JAX-WS, WebBeans, Persistence, EJB, ... all perform resource
injection and its possible to mix annotations from multiple
technologies in a single class. It would be useful to have some
common infrastructure across EE for performing the injection, perhaps
coupled with infrastructure for instance creation and management.

- Consider supporting the standard security annotations defined by
JSR 250 and examine JSRs 196 and 115. JSR 196 offers support for
pluggable authentication and JSR 115 for authorization. JSR 115 may
need a revision to accommodate the more flexible URI patterns
supported by @UriTemplate.


Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.