日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

java添加删除用户信息泄露_java删除用户404错误!!神奇!增改查都没问题啊!!...

發(fā)布時間:2025/4/5 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java添加删除用户信息泄露_java删除用户404错误!!神奇!增改查都没问题啊!!... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一、先把前后端http method統(tǒng)一改為post試下;

二、以下摘自spring官方文檔,希望對你有幫助

HTTP method conversion

A key principle of REST is the use of the Uniform Interface. This means that all resources (URLs) can be manipulated using the same four HTTP methods: GET, PUT, POST, and DELETE. For each method, the HTTP specification defines the exact semantics. For instance, a GET should always be a safe operation, meaning that it has no side effects, and a PUT or DELETE should be idempotent, meaning that you can repeat these operations over and over again, but the end result should be the same. While HTTP defines these four methods, HTML only supports two: GET and POST. Fortunately, there are two possible workarounds: you can either use JavaScript to do your PUT or DELETE, or simply do a POST with the 'real' method as an additional parameter (modeled as a hidden input field in an HTML form). This latter trick is what Spring’s HiddenHttpMethodFilter does. This filter is a plain Servlet Filter and therefore it can be used in combination with any web framework (not just Spring MVC). Simply add this filter to your web.xml, and a POST with a hidden _method parameter will be converted into the corresponding HTTP method request.

(譯)HTTP方法轉(zhuǎn)換

REST的一個關(guān)鍵原則是使用統(tǒng)一接口。這意味著可以使用相同的四種HTTP方法操作所有資源(URL):GET,PUT,POST和DELETE。對于每個方法,HTTP規(guī)范定義了確切的語義。例如,GET應(yīng)始終是一個安全的操作,這意味著它沒有副作用,PUT或DELETE應(yīng)該是冪等的,這意味著你可以一遍又一遍地重復(fù)這些操作,但最終結(jié)果應(yīng)該是相同的。雖然HTTP定義了這四種方法,但HTML只支持兩種:GET和POST。幸運(yùn)的是,有兩種可能的解決方法:您可以使用JavaScript來執(zhí)行PUT或DELETE,或者只使用“real”方法作為附加參數(shù)進(jìn)行POST(在HTML表單中建模為隱藏輸入字段)。后一個技巧是Spring的HiddenHttpMethodFilter所做的。這個過濾器是一個普通的Servlet過濾器,因此它可以與任何Web框架(不僅僅是Spring MVC)結(jié)合使用。只需將此過濾器添加到web.xml,帶有隱藏_method參數(shù)的POST將轉(zhuǎn)換為相應(yīng)的HTTP方法請求。

總結(jié)

以上是生活随笔為你收集整理的java添加删除用户信息泄露_java删除用户404错误!!神奇!增改查都没问题啊!!...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。