========action后台我这里使用的是SpringMVC如果用ssh用法一致===============
@Controller
@RequestMapping("PubjobController")
public class PubjobController {
@Autowired
public PubjobServices pubjobServices;//业务层使用注解的方式
//Pubjob 实体
@RequestMapping("jobMgs")
public String jobMgs(Pubjob job,HttpServletRequest request, HttpServletResponse response)
throws IOException {
System.out.print(job.getId());
System.out.print(job.getName());
response.getWriter().write("操作成功!");
response.getWriter().close();
return null;
}
===========js==============
$.ajax({
type : "POST",
url : '/jubcrm/PubjobController/jobMgs.hml',
data : $("#frmjob").serialize(),//序列化表单提交input 值
success : function(msg) {
alert(msg);
}
},
error : function(msg) {
$.messager.alert(prompts(), "操作失败");
}
});
==========jsp(input 的name必须和实体名称一致)==================
名称:
id:
MySQL_PHP学习笔记_2015_0614_PHP传参总结_URL传参_表单传参
1. PHP 传参总结 1.1 url 传参 解析方法(下面两种解读方式均可以): $firstName1 = $_GET['firstName']; $firstName2 = $_RE ...
HTTP上下文表单内容转为实体对象
using ServiceStack.Web; using System; using System.Collections.Generic; using System.Linq; using Sys ...
序列化表单为json对象,datagrid带额外参提交一次查询 后台用Spring data JPA 实现带条件的分页查询 多表关联查询
查询窗口中可以设置很多查询条件 表单中输入的内容转为datagrid的load方法所需的查询条件向原请求地址再次提出新的查询,将结果显示在datagrid中 转换方法看代码注释
jQuery ajax中使用serialize()方法提交表单数据示例
输入账号 :ajax序列化表单,再也不用通过data去一个个的传值了
jQuery的serialize()方法通过序列化表单值,创建URL编码文本字符串,我们就可以选择一个或多个表单元素,也可以直接选择form将其序列化 这样,我们就可以把序列化的值传给ajax()作为 ...
jQuery ajax序列化函数
参数序列化$.param() 举例: