File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Request,Response  object creation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Request,Response  object creation?" Watch "Request,Response  object creation?" New topic
Author

Request,Response object creation?

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Hi friends i'm new to servlets..
As we know HttpRequest and HttpResponse object are created by the web containers(Containers) .as these two are interface how the container will create object for them if so there is there any class provided by the container which implements HttpRequest and HttpResponse ...please give me a clear picture of this issue.....


Creativity is nothing but Breaking Rules
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
Yes santhosh,
HttpRequest and HttpResponse is an interfaces.
But servlet container will implement that interfaces & create concrete classes.
when we say object of HttpRequest and HttpResponse this that means object of that concrete classes.
we do not need to care about that classes servlet container take care of all that thing.

If you want to see implementation then you need to look in source of any servlet container.
Hope this will Help.


Thanks,
Shailesh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Yes, the container includes classes that implement those interfaces. If you download the container's source code you should be able to find those easily by searching for something like "implements HttpServletRequest".


Ping & DNS - updated with new look and Ping home screen widget
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
You can get source HERE
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Please tell me in which class it is implemented in container source code
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Even if we wanted to tell you, we couldn't, because we don't know which container you're using. Do you know how to search through multiple files for a particular phrase, like the one I suggested in my previous post? ShowSomeEffort
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
That are HttpServletRequestWrapper & HttpServletResponseWrapper for tomcat 5.5.27.


you can find them at <dir>\apache-tomcat-5.5.27-src\apache-tomcat-5.5.27-src\servletapi\jsr154\src\share\javax\servlet\http
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296

I'm using tomcat container where HttpServletRequestWrapper implements HttpServletRequest interface but i could not find the class which extends HttpServletRequestWrapper and HttpServletResponseWrapper
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
HttpServletRequestWrapper & HttpServletResponseWrapper these are concrete classes,
these class's object is created by container.

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Thank you very much.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request,Response object creation?
 
Similar Threads
doGet(HttpRequest, HttpResponse)... Is this legal
Servlets and Threading
Controller redirect to another Controller?
servlet context
question about static page