我在我的 java servlet 中使用该方法:
request.setCharacterEncoding("UTF-8");
我想知道如何才能看到这个界面背后的源代码。
Below is a link to the source code of many Java built in libraries
The implementation of HttpServletRequest is the one provided by your servlet container (Tomcat, Jetty, ...). So, if your container is opensource, print the class of the request:
System.out.prinln(request.getClass());
then find the sources of the servlet container and browse for the class that has been printed. The web page of the container, most of the time, says where the sources can be found.
That said, the contract of the method is well documented in the interface, and you shouldn't have to know how it's implemented to use the method. The documentation should be sufficient.