apatruni
apatruni

Reputation: 75

Implementation of javax.servlet

Where can I find the implementation of ServletResponse/HttpServletResponse and ServletRequest/HttpServletRequest in the tomcat source code?

Tried finding implementations in source but couldn't find any.

Upvotes: 3

Views: 1882

Answers (2)

Eugene K.
Eugene K.

Reputation: 125

Use the Servlet API documentation for Apache Tomcat, reference to which can be easily found on it's official site, for example here is the latest API docs:

https://tomcat.apache.org/tomcat-9.0-doc/servletapi/javax/servlet/http/HttpServletRequest.html

check the following section:

All Known Implementing Classes: HttpServletRequestWrapper

Now, a simple search through the sources will give you the following location:

source_root_dir/java/javax/servlet/http/HttpServletRequestWrapper.java

Upvotes: 0

Ken Chan
Ken Chan

Reputation: 90447

For HttpServletRequest , its implementation is org.apache.catalina.connector.Request. Some of its methods may further delegated to org.apache.coyote.Request which is the most raw request object used internally.

For HttpServletResponse, the Servlet implementation and the most raw response object are org.apache.catalina.connector.Response and org.apache.coyote.Response respectively.

Upvotes: 6

Related Questions