Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
jersey 1.10
guice 3.0-SNAPSHOT
amber 0.22-incubating-SNAPSHOT
Description
I've got a problem with creating OAuthTokenRequest.
It needs an instance of HttpServletRequest on creation, but all instances which I can get through guice or jersey injections have no post parameters.
Guice injection example:
private final Provider<HttpServletRequest> requestProvider;
@Inject
public TokenEndpoint(Provider<HttpServletRequest> requestProvider)
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
public Response authorize() throws OAuthSystemException {
OAuthTokenRequest oauthRequest = null;
try {
oauthRequest = new OAuthTokenRequest(requestProvider.get());
....
Jersey injection example:
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException {
OAuthTokenRequest oauthRequest = null;
try {
oauthRequest = new OAuthTokenRequest(request);
Looks like jersey have parsed HttpServletRequest and removed all post parameters from it.
If I attach filter that tries to get some parameter from HttpServletRequest before jersey, my code works, but with exception from jersey.
But I can retrieve MultivaluedMap of post parameters from jersey with all data and no errors.
I think there must be some alternative constructor for such environments. Any thoughts?