aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes How does servlet container creates an HttpServletRequest object ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "How does servlet container creates an HttpServletRequest object ?" Watch "How does servlet container creates an HttpServletRequest object ?" New topic
Author

How does servlet container creates an HttpServletRequest object ?

Saurabh Kumar
Ranch Hand

Joined: Aug 21, 2006
Posts: 56
Good morning/Evening to all,

I have come across a thought- how does servlet container creates an HttpServletRequest/HttpServletResponse objects as they are interfaces which can't be instantiated directly.
Does that mean there exists a class that implements all the methods declared in these interfaces and the container creates object of those classes.
Dag Corell
Greenhorn

Joined: Sep 19, 2006
Posts: 3
Take a look at HttpServletRequestWrapper and HttpServletResponseWrapper.
Might be what your looking for...
Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Hello,
The service method accepts two parameters HttpServletRequest and HttpServletResponse.The container for example Tomcat, two classes,one that implements the HttpServletRequest and one that implemenmts the HttpServletRespone.The container passes to the service method an instances of the those two classes and you deal with them according to their interface types.


SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How does servlet container creates an HttpServletRequest object ?