android 与 服务器通信
16lz
2021-01-23
android 与 服务器通信
服务端代码:
(1)control 层
/** * 用户登录 * @return */ @RequestMapping(value = "/login",method = RequestMethod.POST) @ResponseBody public String login( @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, HttpSession httpSession){ /* int result = appUserInfoService.getAddr(request);*/ try{ System.out.println(userName+","+userPassword); User user = userService.login(userName,userPassword); if(user == null){ return JSON.toJSONString(-1);//用户名密码错误 }else{ return JSON.toJSONString(user, SerializerFeature.DisableCircularReferenceDetect);//登录成功 } }catch(Exception e) { return JSON.toJSONString(0); } }
(2)service 层
(3)Dao 层
(4)mapping层
参考博客:http://blog.csdn.net/qq_33171970/article/details/54956320
更多相关文章
- android实现发送Email功能(从相册中选择图片作为附件)
- android 在画布上画图片
- Activity之间的通信
- Android BLE学习(二): Android与51822蓝牙模块通信流程的实现与分析
- Android ImageView圆角图片的简单实现
- .net + Android 通信