第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

springMVC表單post提交較長字符串顯示400錯誤?

springMVC表單post提交較長字符串顯示400錯誤?

繁星點點滴滴 2019-03-20 18:15:38
POST提交較短字符串時沒問題,稍長字符串就顯示400錯誤,修改tomcat的server.xml沒用表單只有如下兩個字段,這個content長度就會報錯控制器代碼//處理新聞評論表單提交@RequestMapping(value = "/news", method = RequestMethod.POST)public String doReplyNews(@Validated NewsReplyFormBean newsReplyFormBean, @RequestParam("newsId") int newsId, BindingResult bindingResult, Model model, HttpSession httpSession){    //表單校驗出錯    if(bindingResult.hasErrors())    {        this.fillNewsPageContent(model, newsId);        return "news";    }    //表單校驗成功    else    {        User user = (User)httpSession.getAttribute("user");        //Session登陸校驗失敗        if(user == null)        {            this.fillNewsPageContent(model, newsId);            model.addAttribute("replyError", "請先登陸!");            return "news";        }        //登陸校驗成功        else        {            newsReplyFormBean.setContent(KeywordReplaceUtil.HTMLTageFilter(newsReplyFormBean.getContent()));            //將評論信息插入數(shù)據(jù)庫            userService.addNewsReply(newsReplyFormBean, (long)newsId, user.getUserId());            //組裝重定向URL            return  "redirect:news?id=" + newsId;        }    }}velocity里的表單<form role="form" action="news" method="post" id="form" onsubmit="return check();">    <input type="text" class="sr-only" name="newsId" value="${news.newsId}" />    <div class="form-group">        <label class="control-label sr-only" for="content"></label>        #springBind("newsReplyFormBean.content")        <textarea name="content" class="form-control" id="content" placeholder="說點什么..."></textarea>        <p class="help-block" style="color: red" id="reply_help"></p>        <p class="help-block" style="color: red">$!{replyError}</p>    </div>    <input type="submit" value="提交" /></form>還有個問題,不知道應該怎樣看到這類錯誤的錯誤日志
查看完整描述

1 回答

?
qq_笑_17

TA貢獻1818條經驗 獲得超7個贊

@Validated 確認一下校驗規(guī)則是否滿足。錯誤日志如有有Exception在控制臺或者localhost_access_xxxx.log日志中都可以看到。

查看完整回答
反對 回復 2019-04-24
  • 1 回答
  • 0 關注
  • 833 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號