java后台接收数据
来源:互联网 发布:特朗普减税 知乎 编辑:程序博客网 时间:2024/05/30 19:34
1、getParameter来获取数据
int userId = Integer.parseInt(this.getgetParameter().getParameter("userId")); int tieId = Integer.parseInt(this.getRequest().getParameter("tieId"));
2、java前台–》后台的接收:JSP中直接用属性名称来提交数据:
///////后台
@Component(value="tanWeiAction")public class TanWeiAction extends BaseAction{ private Ttanwei tanwei; public Ttanwei getTanwei() { return tanwei; } public void setTanwei(Ttanwei tanwei) { this.tanwei = tanwei; }/** * 添加摊位 */ public void addTanWei(){ tanwei.setIsValid(true); tanwei.setBeiZhu(""); tanwei.setCatagoryId(0); tanwei.setImgUrl(""); tanwei.setTanWeiName(""); int result=this.tanWeiService.addTanWei(tanwei); if(result>0){ MSG="OK"; }else{ MSG="NO"; } this.writeJson(MSG); }
/////前台:
<form id="tanWeiform" method="post" style="margin:0 auto;"> <input id="tanweiId" name="tanwei.id" type="hidden" /> <input id="imgUrl" name="tanwei.imgUrl" type="hidden" /> <table style="margin:0 auto"> <tr> <th>商品类别:</th> <td><input name="tanwei.catagoryId" id="catagoryTree" class="easyui-combotree" data-options="required:true"> </td> </tr> <tr> <th>摊位名称:</th> <td><input name="tanwei.tanWeiName" id="rname" class="easyui-validatebox" data-options="required:true"> </td> </tr> </table> </form>
3、使用实体类来接收:APP前台发送数据
/////字段名要一致!
Tsignature ts = new Tsignature(); ts.setIsValid(true); ts.setSignatrue(encodingFunction.getMethodEncoding(user.getSignature())); ts.setUserId(user.getId()); int i = this.userService.addUserSignature(ts);
////实现:ModelDriven
@Component(value = "userAction")public class UserAction extends BaseAction implements ModelDriven<User> { private User user = new User(); @Override public User getModel() { return user; } }
0 0
- java后台接收数据
- 前台拼接json数据java后台接收
- 蓝牙后台接收数据
- springmvc 后台接收前台数据
- 前端ajax数据后台接收
- js 接收后台数据推送
- 前台js传入json或map类型数据给后台以及后台java接收操作
- struts 中后台action接收表单数据
- springMVC_后台自动接收list数据
- [蓝牙]蓝牙后台接收数据(BLE4.0)
- iOS蓝牙后台接收数据(BLE4.0)
- 蓝牙后台接收数据(BLE4.0)
- iOS开发- 蓝牙后台接收数据
- iOS蓝牙4.0(BLE)-后台接收数据
- ajax提交数据到后台php接收
- springMvc前台传数据后台接收
- 获取信息,组装数据,后台接收流程
- 蓝牙后台接收数据(BLE4.0)
- uva11100
- java,list,map,set数组
- C++四种类型转换
- 我的MYSQL学习心得(十五) 日志
- 异步编程 In .NET
- java后台接收数据
- Android View的可见属性
- Jsp学习笔记:javaBean属性命名规范
- wireshark使用
- 我对读博和金融专业的一些认识
- 高振啊!闲来无事多读读 考研失败总结
- APlayerController继承关系图
- JakeWharton大神的大作
- [leetcode 260] Single Number III