I am struggling to pass a json object and a string as parameters to my Java controller.
Despite my efforts, I keep receiving url = ""
in the controller.
- What could be causing this issue?
- Is there a solution to successfully passing these parameters?
$scope.executeRequest = function(){
var url = "http://"+$scope.data.serverIP+":"+$scope.data.serverPort;
$http.post('/admin/executeRequest/',JSON.parse($scope.data.request),url).success(function(data){
$scope.data.response = data;
}).error( function ( data, status ) {
$log.info("getting request object for api from server : failure");
if ( status === 403 ) {
$scope.show403( data );
}
});
};
@RequestMapping(value="/admin/executeRequest/",method=RequestMethod.POST)
@ResponseBody
public ProductCategoryResponse executeRequest(@RequestBody ProductCategoryRequest request, String url){