jsp文本框输入的中文值在另一个页面中当参数取出来是乱码

2024-12-30 09:20:44
推荐回答(1个)
回答1:

第二个页面:post 方法中文处理

<%@ include file="Head.jsp"%>
<%
request.setCharacterEncoding("GBK");
String p_name = request.getParameter("p_name");
double p_price = Double.parseDouble(request.getParameter("p_price"));
double p_weight = Double.parseDouble(request.getParameter("p_weight"));
String p_desc = request.getParameter("p_desc");
out.println(p_name);
%>