• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How does servlet container creates an HttpServletRequest object ?

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at HttpServletRequestWrapper and HttpServletResponseWrapper.
Might be what your looking for...
 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic