title: How to get form parameters as object in restful webservice
body: <p>I have a login form with two values name and password. I pass this value as in my rest service. I get this value in my rest service using <code>FormParam</code> annotation. But, my requirement is to get that values as a class. I tried below methodology. But it's not work and shows the compile time error:
  <code>@Form cannot be resolved to a type.</code></p>
  
  <pre><code>@POST
  @Path("login")
  @Produces(MediaType.TEXT_PLAIN)
  public String login(@Form User form) {
       return "Logged with " + form.email + " " + form.password;
  }
  
  public class User {
  
        @FormParam("email")
        private String email;
  
        @FormParam("password")
        private String password;
  
  }
  </code></pre>
  
  <p>My form is</p>
  
  <pre><code>&lt;form method="POST" action="rest/login"&gt;
  
  
  Email Address: &lt;input type="text" name="email"&gt;
  &lt;br&gt;
  Password: &lt;input type="text" name="password"&gt;
  &lt;input type="submit"&gt;
  
  
  &lt;/form&gt;
  </code></pre>
  
  <p>How to receive form value as object?</p>