Calling struts2 action class from angular JS using $http.post()

462 views Asked by At

I facing trouble in passing data from AngularJS $http.post() to Action Class in JAVA.

My action class is not getting called.

Controller.js

I am calling my action class AuthenticateLogin from the my Angular JS controller using http.post() along with sending my username and password in JSON format.

AuthenticateLogin.java

AuthenticateLogin

1

There are 1 answers

0
Andrea Ligios On

You are missing the action extension. And potentially the namespace.

It should be

$http.post('AuthenticateLogin.action', data)

or

$http.post('/AuthenticateLogin.action', data)