spring mvc json ie 下载

 

  
  
  
  
  1. @RequestMapping("t5"
  2.     public ResponseEntity<Map<String, Object>> t5() { 
  3.         HttpHeaders headers = new HttpHeaders(); 
  4.         headers.setContentType(MediaType.TEXT_PLAIN); 
  5.         Map<String, Object> map = new HashMap<String, Object>(); 
  6.         map.put("success"true); 
  7.         map.put("id", UUID.randomUUID().toString()); 
  8.         ResponseEntity<Map<String, Object>> entity = new ResponseEntity<Map<String, Object>>( 
  9.                 map, headers, HttpStatus.OK); 
  10.  
  11.         return entity; 
  12.     } 

 

你可能感兴趣的:(spring,mvc,json)