日期:2014-05-16 浏览次数:20491 次
对Servlet??中?request.setEncoding("utf-8")的分析
?
首先要知道这里的request为HttpServletRequest,如果我们打印request的话,发现打印出的类型为?RequestFacade(package?org.apache.catalina.connector;?public?class?RequestFacade?implements?HttpServletRequest?)?,这里的RequestFacade对象实现了HttpServletRequest接口。
?
通过源码有如下发现:
?protected?Request?request=null;??
(package?org.apache.catalina.connector)
?public?RequestFacade(Request?request)?{
????????this.request?=?request;
?}
request对象通过