title: Spring MVC 3 - optional URL parameter
body: <p>I've written following code:</p>
  
  <pre><code>@Controller
  @RequestMapping("/page{number}")
  public class IndexController
  { 
      @RequestMapping(method = RequestMethod.GET)
      public String printIndex(ModelMap model, @PathVariable int number)
      {
          String numberText;
  
          switch (number)
          {
              case 0:
                  numberText = "Zero";
                  break;
              case 1:
                  numberText = "One";
                  break;
              default:
                  numberText = "Unknown";
                  break;
          }
  
          model.addAttribute("number", numberText);
  
          return "page";
      }
  }
  </code></pre>
  
  <p>And I'm tring to achieve URLs like page1.html, page2.html, page3.html controlled by this method, with one exception: page.html should give same result as page1.html. I'm looking for something to make {number} optional, now it's required.</p>
  
  <p>Is there a way to do that at I said?</p>
  
  <p>/</p>