HiddenHttpMethodFilter

  1. 轉換成指定的請求方式(post/put)
  2. 用法
    1. 在SpringMvc 中配置HiddenHttpMethodFilter(Spring boot 自動配置)
    2. 頁面創建一個post表單
    3. 創建一個input標籤,name="_method" 值就是我們要轉換成爲的請求方式
        <input type="hidden" name="_method"  th:if="${emp!=null}" value="put">

       

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