简体   繁体   English

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

[英]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.我在将数据从 AngularJS $http.post()传递到 JAVA 中的 Action 类时遇到了麻烦。

My action class is not getting called.我的动作课没有被调用。

Controller.js控制器.js

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

AuthenticateLogin.java验证登录.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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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