ztree插件異步加載 使用RESTEasy報錯 Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.


 
        
在使用ztree插件實現異步加載時遇到后台RESTEasy接收參數問題,查看后台報錯:
A servlet request to the URI http://localhost:8080/area/query contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters.
Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
根據錯誤提示,需要使用@FormParam("code")接收ztree出來的參數

ztree異步加載配置:

async: {
enable:true,
url:"/area/query", //點擊父節點,調用@Path("query")方法
autoParam:["id=code"],//給id起別名,后台接收code
}

 


免責聲明!

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



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