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.     } 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章