jsp页面获取url中的参数并且防止中文乱码 ,在jsp中写如如下代码:
<%request.setCharacterEncoding("UTF-8"); String name = new String(request.getParameter("name").getBytes("ISO8859-1"),"UTF-8"); request.setAttribute("name", name); %>2.要想先执行servlet再执行jsp页面,需要在web.xml中加入如下代码:
<welcome-file-list> <welcome-file>Servlet/selectServlet</welcome-file> </welcome-file-list>