问答详情
源自:5-6 setProperty

解决中文乱码时报错了

为什么我添加了<%request.getcharacterencoding("utf-8");> 以后会报错呢?   报错信息:The method getCharacterEncoding() in the type ServletRequest is not applicable for the arguments (String)

提问者:晟晟online 2016-07-27 20:08

个回答

  • SUNSHINE健
    2016-07-27 20:51:09
    已采纳

    <%request.setCharacterEncoding("utf-8") ;%>//(注意是set,不是get)

    <jsp:useBean id="myUsers" class="com.po.Users" scope="page"></jsp:useBean>


  • qq_卖萌_03719200
    2016-07-27 20:19:11

    <% 

      request.setCharacterEncoding("utf-8");

    %>这样的吧