I have created a dynamic web project in eclipse using maven 3 .i used from angularjs in client side and spring and spring security as backend technology.
when i run project it correctly redirects to to the root context and login page,
but when i want to run this javascript :
angular.module('common')
.controller('BaseFormCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.login = function (username, password) {
$http({
method: 'POST',
url: '/authenticate',
data: postData,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"X-Login-Ajax-call": 'true'
}
})
.then(function(response) {
if (response.data == 'ok') {
window.alert("login success");
}
else {
window.alert("login faild");
}
});
}
}])
it return this error:
POST http://localhost:8080/authenticate 404 (Not Found)
but i expect that it call this: http://localhost:8080/avl-web/authenticate
which avl-web is my root context
thanks in advanced
Aucun commentaire:
Enregistrer un commentaire