@HttpEntity參數(怪異)


1)、在Controller中寫

與@RequestBody請求體對應

@HttpEntity更強大,不光有請求體,還能獲取請求頭

@RequestMapping("/test02")
    public String test02(HttpEntity<String>  str){
        System.out.println(str);
        return "success";
    }

2)、在頁面中寫;

同樣是form表單

<form action="${ctp }/test02" method="post" enctype="multipart/form-data">
   <input name="username" value="tomcat" /> 
<input name="password" value="123456"> <input type="file" name="file" />
<input type="submit" /> </form>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM