how about one resource file has two different methods both annotated with @Post
Created by Wang, Jerry, last modified on Jul 28, 2016
測試結果:只有第一個method add 的參數Advertisement的構造函數會被call到。框架檢測到這種duplicate情況,報了一個warning:
2016-07-28 14:44:14,420 WARN [http-bio-9098-exec-6] - [org.apache.cxf.jaxrs.utils.JAXRSUtils] [] - Both com.sap.bulletinboard.ads.resources.AdvertisementResource#addJS and com.sap.bulletinboard.ads.resources.AdvertisementResource#add are equal candidates for handling the current request which can lead to unpredictable results
Advertisement constructor
Advertisement setter called: scala3
把add的@POST去掉,再執行post,得到期望的第二個方法JavaScript 構造函數被調用:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的how about one resource file has two different methods both annotated with @Post的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tf内存卡和sd卡区别(tf卡和sd卡的
- 下一篇: 股票怎么选优质股