So I have my angular javascript as
var app = angular.module('app', []);
app.controller('controller', function($scope, $http) {
$http.get('http://localhost:8080/core/students.json')
.success(function(data) {
$scope.user = data;
});
});
and my rest controller with
@RestController
public class StudentRestController {
@RequestMapping(value = "/students", produces = { "application/json" }, method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public Student getStudent() {
// return studentService.getStudentByUserName(userName);
Student s = new Student();
s.setUserName("userName");
s.setEmailAddress("email");
return s;
}
}
but for some reason, the javascript ajax request isn't hitting the method getStudent(). Why is this? I get a console error
"GET http://localhost:8080/core/students.json 404 (Not Found)"
ordinary button url calls work as expected