Hi all,
Just a quick question to find out if there's a sensible way to control the
contents of the "Allow" header with some form of delegate pattern, or
similar.
My research to date indicates that the JAX-RS 2 spec support for handling
the Allow header is:
- Specifying the Allow header content using the ResponseBuilder (as part
of normal processing)
- Providing an @OPTIONS annotated method for direct Http Options requests
- Some reflection based (auto) generation of the supported methods
during handling of a NotAllowedMethod (405), specifically in
MethodSelectingRouter::getMethodRouter
To provide some context to what I'm trying to do...
I have a collection that is POST accepting for some of the time. When the
parent object is deemed *complete* no further POSTing of subordinate
resources is permitted. In this way, an OPTIONS request to the subordinate
(collection) should change from POST accepting to non-POST accepting e.g.
"GET, POST, OPTIONS" -> "GET, OPTIONS"
Have I missed something obvious, of am I off on a deep(er) journey into the
Jersey internals?
Note: I've also looked at Filters as a possible way of achieving this, but
see no easy path to "get back to" the calling context i.e. a method in the
resource class.
Thoughts welcomely received
Best regards
Paul