spring mvc在接收数据时包含日期格式的数据,报404

@InitBinder  
	public void initBinder(WebDataBinder binder) {  
	    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");  
	    dateFormat.setLenient(false);  
	    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));  
	}

springmvc不支持日期格式参数传递,需要在controller里加如上述代码,注册日期格式转换器

猜你喜欢

转载自blog.csdn.net/qq_21860997/article/details/82770875
今日推荐