angularjs - send json data to struts using angular js -


i receiving data null in struts2 action class. 

following code written on jsp page.sending linedetails struts2 action class. var app = angular.module('myapp', ['ngroute']); app.controller('mycontroller', ['$scope', '$http', function($scope, $http) { var linedetails = {lineid:0};

      var data=angular.tojson(linedetails);   $http.post("actionclassname",data, {headers: {'content-type': 'application/json'} }).success(function(data, status, headers, config) {          }).error(function(data, status, headers, config) {             alert( "failure message: " );          }); }]);  in action class in accessing data variable printing null  gson gs=new gsonbuilder().serializenulls().create();              system.out.println("data is:"+data); 


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -