-1

我在我的 java servlet 中使用该方法:

request.setCharacterEncoding("UTF-8");

我想知道如何才能看到这个界面背后的源代码。

4

2 回答 2

0

Below is a link to the source code of many Java built in libraries

Reference for the servlet request class

于 2013-03-02T16:22:27.090 回答
0

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.

于 2013-03-02T16:22:31.343 回答