Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RestEasy] @FormParam params reset to null 2.0 RC3 . Works fine in 1.0.15 #1256

Closed
ucfstevie opened this issue Aug 28, 2013 · 4 comments
Closed

Comments

@ucfstevie
Copy link

I use a RestEasy implementation and pass params to the server using POST.
My Java Script Code:

function loginUser(userName,password){
$.ajax({
  type: "POST",
  contentType : 'application/x-www-form-urlencoded',
  url: getLogonUrl(),
  data: { "userName": userName, "password" : password },
  success: function(msg){
  handleLogonSuccess(msg,userName);      
  },
  error: function(xhr, textStatus, errorThrown) {
    console.log("error :" + xhr.responseText);
    console.log("status code :" + xhr.status);
    showLoginMessage(xhr.responseText,'red');
  }
});
}

Server Side Code:

   @POST
   @Securable
   @Path("doLogon")
   @Produces("text/plain")
   public Response  logonUser(@FormParam("userName") String userName, @FormParam("password")String password,@Context HttpServletRequest servletRequest){
            System.out.println("userName :" + userName);
            System.out.println("password:" + password);
}

Using 1.0.15 my username/password params work fine. Upgrading to 2.0 RC3 the username/password are always null.

@ucfstevie
Copy link
Author

Sad to say this is still an issue with the latest build. I did some debugging it and it seems the problem is in AtmosphereFramework configureRequestRespons(AtmosphereRequest req, AtmosphereResponse res).

The Problem is the call to Map<String, String> headers = configureQueryStringAsRequest(req);. That method depends on the AtmosphereRequest queryString being set. This is not set until further down in configureRequestResponse. Because of this, the headers always return as empty.

@jfarcand jfarcand reopened this Sep 5, 2013
@jfarcand
Copy link
Member

jfarcand commented Sep 6, 2013

Seems like an issue only with RestEasy. With Jersey, it works as expected. The sample use @FormParam

@jfarcand
Copy link
Member

jfarcand commented Sep 6, 2013

OK now properly fixed. Sorry for that.

@ucfstevie
Copy link
Author

Retested and issue has been resolved. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants