1.獲取頁面中的屬性值:
String username = request.getParameter("username");
2.修改字符集格式
username = new String(username.getByte("ISO-8859-1"),"GB2312");
上面的getByte中的參數是頁面中的字符集,String方法的第二個參數是目標字符集。
3.jsp頁面獲取路徑兩種方法
<c:out value="${pageContext.request.contextPath}"/>
<%=request.getContextPath()%>