|
我在前端使用ajax的方式传值,- $.ajax({
- type: 'post',
- url: "http://localhost:8080/baas/Test/service" ,
- data: {
- method : "test",
- ID : "1"
- } ,
- success: function () {
- alert("成功");
- } ,
- dataType: "json"
- });
复制代码
这样在后台无法获取数据data,请指教,下面是java后台代码
- // 程序的入口选择调用的方法
- public static JSONObject service(JSONObject params, ActionContext context) throws SQLException, NamingException, ParseException {
- JSONObject responseParams = null;
- try {
- System.out.println("连接成功");
- String action = params.getString("method");
- System.out.println(action);
复制代码
控制台显示可以连接成功,但是就是不能获取到前端传递过来的data |
|