springMVC标签表单的提交与后台的接受

前台:

	<form:form id="searchForm" modelAttribute="user" action="${ctx}/sys/user/" method="post" class="breadcrumb form-search">
					          <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		                	开始时间:<input type="text" id="start" name="start" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" style="width:200px" />
		        结束时间<input type="text" id="end" name="end" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" style="width:200px" />	
		            	
		            	
		            	
		            	<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page(2,10);"/>
			            <input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
                	</form:form>
	<script type="text/javascript">
		$(document).ready(function() {
		
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/sites/videoLzw");
			$("#searchForm").submit();
	    	return false;
	    }
		
	</script>

后台:

/**
 * @author LzwGlory
 * @version 2013-12-19
 * */

@Controller("VideoController")
@RequestMapping(value = "${adminPath}/sites/videoLzw")
public class VideoController{

	@Resource
	private  TVideoService tVideoService;
	@RequestMapping(value = {"list", ""})
	public String list(TVideo tVideo,HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) {
		
		Page<TVideo> page = tVideoService.findTVideo(new Page<TVideo>(request, response), tVideo); 
		System.out.println("-----------list--------------");
		System.out.println(request.getParameter("pageNo"));
		System.out.println(request.getParameter("pageSize"));
		System.out.println(request.getParameter("start"));
		System.out.println(request.getParameter("end"));
		
		modelMap.put("page", page);
		
		return "modules/sites/video";
	}

}

request.getParameter("pageNo");对应的是name属性

还要加上这句话:<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 在最上面

你可能感兴趣的:(springMVC)