title: Spring MVC @RequestParams
body: <p>This is the url :
  <a href="https://192.168.33.10/openmrs/ws/rest/v1/bahmnicore/bahmniencounter/search?includeAll=false&amp;patientUuid=210d0739-7937-4fb7-8f53-752f393cb4b7&amp;visitUuid=c1c26908-3f10-11e4-adec-0800271c1b75" rel="nofollow">https://192.168.33.10/openmrs/ws/rest/v1/bahmnicore/bahmniencounter/search?includeAll=false&amp;patientUuid=210d0739-7937-4fb7-8f53-752f393cb4b7&amp;visitUuid=c1c26908-3f10-11e4-adec-0800271c1b75</a></p>
  
  <p>It is landed into Spring MVC's below controller method -</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, value = "search")
  @ResponseBody
  public List&lt;BahmniDiagnosisRequest&gt; search(@RequestParam("patientUuid") String patientUuid, @RequestParam(value = "fromDate", required = false) String date, String visitUuid) throws Exception {
      if (visitUuid != null) {
          return bahmniDiagnosisService.getBahmniDiagnosisByPatientAndVisit(patientUuid, visitUuid);
      } else {
          return bahmniDiagnosisService.getBahmniDiagnosisByPatientAndDate(patientUuid, date);
      }
  }
  </code></pre>
  
  <p>If you see the spring annotation <code>@Request</code> Params is not present for the <code>visitUuid</code> parameter.</p>
  
  <p>The code above used to work even though the parameter was not present. But recently it throws an Exception, there is no request parameter for <code>visitUuid</code>.
  Solution is simple if I add <code>@RequestParams("visitUuid")</code> it works.</p>
  
  <p>But my question is can parameter in a GET request get mapped to appropriate variables on the Controller code even if we don't have a <code>@RequestParamter</code> mapping.</p>