title: Optional int parameter 'page' is present but cannot be translated into a null value due to being declared as a primitive type.
body: <p>I am developping a web application with spring boot and angular Js , i want to add pagination to my interface but it gives me the error mentioned in the title: Optional int parameter 'page' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.</p>
  
  <p>Here's my java Controller</p>
  
  <pre><code>@RequestMapping(value="/getReports",method=RequestMethod.GET)
      public Page&lt;DetailsReport&gt; getTables(int page){
          return detailsReportRepository.findAll(new PageRequest(page,5));
      }
  </code></pre>
  
  <p>Here's my Js Controller</p>
  
  <pre><code>$scope.pageCourante=0;
  
  
          $scope.loadReports=function(){
              $http.get("/getReports?page="+$sope.pageCourante)
               .success(function(data){
                   $scope.reports=data;
                  $scope.pages=new Array(data.totalPages) 
  
               });
          }
          $scope.gotoPage = function(p) {
              $scope.pageCourante = p;
              $scope.loadReports();
          }
  </code></pre>
  
  <p>And here's the html</p>
  
  <pre><code>&lt;div class="container"&gt;
               &lt;ul class="nav nav-pills"&gt;
              &lt;li ng-class ="{active:$index==pageCourante} "  class="clickable"
                  ng-repeat="p in pages track by $index"&gt; &lt;a
                  ng-click="gotoPage($index)"&gt;{{$index}}&lt;/a&gt;
              &lt;/li&gt;
              &lt;/ul&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Any ideas?</p>