i have angular controller which triggered with ng-click:
app.controller('showAllWorkersContoller', function($scope, $http){
$http.get("/SafetyManager/workers").success(function(response){
$scope.workers = response;
$scope.workerInfo = function(id){
$http({
url: '/SafetyManager/workers',
method: "POST",
data: { 'ID' : id },
}).success(function(response){
$scope.info = response;
});
};
});
});
and when i check on chrome debug it sends in form data: {'ID':"1"} (or any other id num according to the worker i click on)
but when the Servlet get the request:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("post request to Workers (get worker by id )");
String id = request.getParameter("ID");
System.out.println("this id is: " + id);
}
its print :
post request to Workers (get worker by id )
this id is: null
how can i get the ID value in the servlet?