title: POSTing with Jersey & JQuery
body: <p>I'm having an issue POSTing to Jersey using the following...</p>
  
  <pre><code>var details = {username: uname, password: pword};
  $.post('login',function(details){
      console.log("sent: "+details);
  });
  </code></pre>
  
  <p>The correct function in my login page is being ran but both <code>username</code> and <code>password</code> are null.</p>
  
  <p>The following is how I consume them...</p>
  
  <pre><code>   public void login(@FormParam("username") String uname,
             @FormParam("password") String pword){
         System.out.println("username = " +  uname + "password = " + pword);
     }
  </code></pre>
  
  <p>I realise what I POST isn't a form but <code>@FormParam</code> is the only <code>@</code> I can see that would fit here.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Okay, I've got the following right now...</p>
  
  <p><strong>the POST being made</strong></p>
  
  <pre><code>    var details = {'username': username, 'password': password};
  $.POST('login', details,function(result){
      console.log(result);
  },"json");
  </code></pre>
  
  <p><strong>The receiving method</strong></p>
  
  <pre><code>@POST
   public Viewable HeyStaksLogin(LoginInfo loginI){
         String uname = loginI.username;
         String pword = loginI.password;
         System.out.println("username = ");
   }
  </code></pre>
  
  <p><strong>The <code>loginInfo</code> class</strong></p>
  
  <pre><code>@XmlRootElement
  public class LoginInfo {
  public String username;
  public String password;
  }
  </code></pre>