title: How do I pass String input from a webpage to @RestController as a Java object?
body: <p>My question is very basic.</p>
  
  <p>I have the following html:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="/login" method="GET"&gt;
    &lt;div&gt;
      Id: &lt;input type="text" name="id" value="id"/&gt;
      Name:  &lt;input type="text" name="name" value="name"/&gt;
    &lt;/div&gt;
      &lt;button&gt;Login&lt;/button&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>And the following <code>@GetMapping</code> method to which I want to connect:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code> @GetMapping("/login")
    public String someLogin(LoginObject obj, HttpServletRequest request) {
      //do something
    }
  </code></pre>
  
  <p><code>LoginObject</code> is composed from two fields: <code>id</code> and <code>name</code>, which I am taking from the UI. How do I convert two strings to my <code>LoginObject</code> and then pass it to the <code>@RestController</code></p>