jsp页面如何通过url传递汉字
初学java web开发,第一个问题就是jsp页面如何通过url传递汉字?
第一个index.jsp页面
<a href="helloword.jsp?name=<%=URLEncoder.encode("张三","utf-8") %>&sex=bb">解决中文乱码</a>
第二个hellorword.jsp页面
name参数的值为:<%=request.getParameter("name")%>
sex参数的值为:<%=request.getParameter("sex") %>
方法很简单。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。