使用Springmvc @requestBody注解接收不到用实体类接收的json数据,http 415错误

servlet.xml文件中加入

	


    
        
        
        
    

或者这么加:

@RequestBody接收json数据


		
		
			
				
					
						text/plain;charset=UTF-8
						text/html;charset=UTF-8
						application/json;charset=UTF-8
					
				
			
		
	

 

pom文件中

然后再添加一个jackson的jar包


			com.fasterxml.jackson.core
			jackson-databind
			2.1.4

 

@ResponseBody
	@ControllerPointcut(description = "应用状态申请")
	@RequestMapping(value = "/applyAppStatus", method = RequestMethod.POST)
	public JSONObject applyAppStatus(@RequestBody ApplicationVo applicationVo) throws HttpRequestException, PaasException {
		return ApplicationServiceUtils.applyAppStatus(applicationVo);
	}

 

你可能感兴趣的:(------【spring】,●架构设计)