title: "command" modelName magic value in spring MVC 3
body: <p>How to remove some of the "magic value" impression of <code>"command"</code> modelName parameter to create a ModelAndView ?</p>
  
  <p>Example:</p>
  
  <pre><code>@RequestMapping(value = "/page", method = GET)
  public ModelAndView render() {
      return new ModelAndView("page", "command", new MyObject());
  }
  </code></pre>
  
  <p>One hope was to use a spring constant such as</p>
  
  <pre><code>new ModelAndView("page", DEFAULT_COMMAND_NAME, new MyObject());
  </code></pre>
  
  <p>I found <code>"command"</code> in the 3 following classes of the spring-webmvc-3.0.5 sources jar:</p>
  
  <pre><code>$ ack-grep 'public.*"command"'
  org/springframework/web/servlet/mvc/BaseCommandController.java
  140:    public static final String DEFAULT_COMMAND_NAME = "command";
  
  org/springframework/web/servlet/mvc/multiaction/MultiActionController.java
  137:    public static final String DEFAULT_COMMAND_NAME = "command";
  
  org/springframework/web/servlet/tags/form/FormTag.java
  56: public static final String DEFAULT_COMMAND_NAME = "command";
  </code></pre>
  
  <p>The problem is :</p>
  
  <ul>
  <li><code>BaseCommandController</code> is deprecated</li>
  <li>We don't use <code>MultiActionController</code> and <code>FormTag</code></li>
  </ul>