SpringMVC

返回字符串需要加produces="text/html;charset=UTF-8",如:

@RequestMapping(value = "/getUserNames",produces="text/html;charset=UTF-8")
	@ResponseBody
	public String getUserNames(int task_id){
		return baseService.getUserNames(task_id);
	}

返回void需要加@ResponseBody.否则报404


>"redirect:/";返回项目根路径

你可能感兴趣的:(SpringMVC)