1、解决网页输入框输入中文时返回乱码:
原因:在使用HttpServletRequest.getParameter(String name)时我们可能会取得中文的乱码。
问题描述:当利用getParameter()方法去取HTML元素中value值时,当元素的value值为中文时,用该方法取到的值可能为乱码,这时候我们需要的取得它的中文
解决方法:request.setCharacterEncoding("utf-8");