错误The request sent by the client was syntactically incorrect ()的解决
生活随笔
收集整理的這篇文章主要介紹了
错误The request sent by the client was syntactically incorrect ()的解决
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
這個(gè)錯(cuò)誤是SpringMVC報(bào)出來(lái)的,見到它意味著html/jsp頁(yè)面的控件名稱 和 controller里函數(shù)的參數(shù)不符。
<form name="form1" action="uploadDocument.html" method="post" ENCTYPE="multipart/form-data"><div class="form" ><p><span class="req"><input id="remarkTxt" name="remarkTxt" class="field size4" title="Enter the date" /></span><label>Remark: <span>(The brief introduction of the file)</span></label></p><p><span class="req"><input type="file" name="uploadFileCtrl" class="field size4" title="Choose the file" /></span><label>Upload file: <span>(Click browse to choose)</span></label></p></div><div class="buttons"><input id="queryBtn" type="button" class="button" value="Submit" /></div></form>?
而對(duì)應(yīng)的函數(shù)參數(shù)應(yīng)該這樣寫:
?
@RequestMapping(value="/uploadDocument")public String uploadDocument( @RequestParam("remarkTxt") String remark, @RequestParam("uploadFileCtrl") MultipartFile file,HttpServletRequest request,HttpServletResponse response){....} }?
? 以后碰到這條錯(cuò)誤信息時(shí),首先應(yīng)檢查從客戶端提交的數(shù)據(jù)是否與Controller 處理方法接收的參數(shù)類型一致,換句話說(shuō),POST的數(shù)據(jù)結(jié)構(gòu)類型應(yīng)和接收時(shí)進(jìn)行類型匹配自動(dòng)轉(zhuǎn)換的數(shù)據(jù)類型要一致。
轉(zhuǎn)載于:https://my.oschina.net/u/3503268/blog/2249175
與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的错误The request sent by the client was syntactically incorrect ()的解决的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 提取pfx证书公钥和私钥
- 下一篇: 为什么ABAP整型的1转成string之