Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request,Response object creation?

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.....
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get source HERE
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me in which class it is implemented in container source code
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequestWrapper extends ServletRequestWrapper
implements HttpServletRequest

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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequestWrapper & HttpServletResponseWrapper these are concrete classes,
these class's object is created by container.

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic