java添加删除用户信息泄露_java删除用户404错误!!神奇!增改查都没问题啊!!...
一、先把前后端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。幸運的是,有兩種可能的解決方法:您可以使用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)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MySQL是自主可控的吗_国产处理器那么
- 下一篇: 临沂罗庄区远通二手车市场开车不走高速到河