使用$ http.post()从角度JS调用struts2动作类

时间:2015-12-23 11:09:59

标签: java angularjs post struts2 struts-action

我在将数据从AngularJS $http.post()传递到JAVA中的Action Class时遇到了麻烦。

我的动作类没有被调用。

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 个答案:

答案 0 :(得分:0)

您缺少动作扩展程序。可能是命名空间。

应该是

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

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