简体   繁体   中英

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

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

My action class is not getting called.

Controller.js

我正在使用 http.post() 从我的 Angular JS 控制器调用我的操作类 AuthenticateLogin,并以 JSON 格式发送我的用户名和密码。

AuthenticateLogin.java

验证登录

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

It should be

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

or

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM