Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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