title: how to map "a-b" query to a command object in Spring MVC
body: <p>I used to use "@RequestParam("a-b") String foo" to receive the "a-b" parameter from http query.</p>
  
  <p>now I want to switch to Command Object, but I don't how to receive this param, I tried following 4 forms "ab", "aB", "a_b", "a_B", but neither works, for example, the following code will result as</p>
  
  <p>URL: <a href="http://localhost:8080/test1?a-b=1" rel="nofollow noreferrer">http://localhost:8080/test1?a-b=1</a><br>
  Result: <code>Foo{ab='null', aB='null', a_b='null', a_B='null'}</code></p>
  
  <p>Thanks in advance</p>
  
  <pre><code>@Controller
  public class TestController {
  
  @RequestMapping("/test1")
  public String test1(
      Foo foo,
      HttpServletResponse response
  ) throws IOException {
      response.setContentType("text/plain");
      response.getOutputStream().write(foo.toString().getBytes("UTF-8"));
      return null;
  }
  
  
  public static class Foo {
  
      private String ab;
      private String aB;
      private String a_b;
      private String a_B;
  
      // getter and setter
      ...
  
      @Override
      public String toString() {
          return "Foo{" +
                  "ab='" + ab + '\'' +
                  ", aB='" + aB + '\'' +
                  ", a_b='" + a_b + '\'' +
                  ", a_B='" + a_B + '\'' +
                  '}';
      }
  }
  
  
  
  
  
  }
  </code></pre>