users@jsr311.java.net

Re: implementing "OPTIONS *"

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Sun, 31 Jan 2010 21:06:50 -0500

On Jan 29, 2010, at 7:10 AM, Reto Bachmann-Gmuer wrote:
>
> I was wondering bout what the recommended way to implement OPTIONS * requests.
>
> What comes to mind:
> • looking at the Http-Method annotations of all registered root resources. Problem: Methods only supported by sub resources are not found
> • scanning the classpath for Http-Method annotations types. Problem: Can be hard depending on classpath settings (OSGi). Having them in the classpath doesn't mean they're actually used somewhere (but having OPTIONS * returning to many methods is the lesser problem).
>
I suspect the issue for a lot of implementations is that containers will probably handle OPTIONS * without dispatching the request to installed applications. If you control the container then either of the above looks like a reasonable approach to me.

Marc.