title: spring servlet-mapping / url-pattern
body: <p>I have this servlet-mapping</p>
  
  <pre><code>&lt;servlet-mapping&gt;
          &lt;servlet-name&gt;devicesWeb&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/device-catalogue&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/device-catalogue/&lt;/url-pattern&gt;                
          &lt;url-pattern&gt;/device-catalogue/*&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/search/search.do&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>With these 2 methods:</p>
  
  <pre><code>   @RequestMapping(value = "/device-catalogue", method = RequestMethod.GET)
          private String initForm(@ModelAttribute("searchForm") final SearchForm searchForm, 
                                   BindingResult result, HttpServletRequest request, Model model, Locale locale) {
  
              sessionHelper.checkSessionAttributes(request,  locale);
              return SEARCH_VIEW;
          }
  
  
  @RequestMapping(value = { "/search/showProductDetails.do",  "/device-catalogue/{id}" },  method = { RequestMethod.GET, RequestMethod.POST })
      private String showProductDetails(@ModelAttribute("searchForm") final SearchForm searchForm, 
                                HttpServletRequest request, Model model, Locale locale) {
  
          StringTokenizer st = new StringTokenizer(StringEscapeUtils.escapeHtml(searchForm.getItemId()),"=");
  
          if (st.countTokens()&gt;1) {
  
              String awardId=st.nextToken();
              String id=st.nextToken();
  
              Item item = deviceService.getItemByAwardId  (Long.parseLong(id), awardId);
  
              normalizeWebsiteURL (item);
  
              orderCountriesAvailability(item.getCountriesAvailability(), locale);
  
              model.addAttribute("item", encodeItemForHTML(item));    
          }
          return PRODUCT_DETAIL_VIEW;
      }
  </code></pre>
  
  <p>This URL works fine:</p>
  
  <p><a href="http://127.0.0.1:7001/eDevices/device-catalogue" rel="nofollow">http://127.0.0.1:7001/eDevices/device-catalogue</a></p>
  
  <p>But not this one (I got a 404) !</p>
  
  <p><a href="http://127.0.0.1:7001/eDevices/device-catalogue/16720" rel="nofollow">http://127.0.0.1:7001/eDevices/device-catalogue/16720</a></p>
  
  <p>If I add this to the web.xml it works</p>
  
  <pre><code>&lt;url-pattern&gt;/product-catalogue/16720&lt;/url-pattern&gt;
  </code></pre>