Character encoding JSP -displayed wrong in JSP but not in URL: “á » á é » é”

后端 未结 10 1777
忘掉有多难
忘掉有多难 2020-12-03 08:24

I have this Web Application in JSP running on JBoss Application Server. I am using Servlets for friendly urls. I\'m sending search parameters through my JSP\'s and Servlets.

10条回答
  •  长情又很酷
    2020-12-03 08:41

    Just a wild guess. Try this inside your JSP/Servlet:

    if(request.getCharacterEncoding() == null) {
       request.setCharacterEncoding("UTF-8");
    }
    

    You need to be sure that the correct encoding is passed to your servlet.

提交回复
热议问题