• Post Reply Bookmark Topic Watch Topic
  • New Topic

interfce and implementation of method  RSS feed

 
psachin joshi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we use getParameter() and other methods of httpServletRequest interface but we dont implement it so i want to know where and who implement these methods.
also we make httpServletRequest object pass in doget method to call these methods how it is possible to make an object of an interface.
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is implemented by vendor whose container you are using, it is the container's responsibility to pass an appropriate instance of the classes implementing the ServletRequest and ServletResponse interfaces to service method.
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the servlet container who implements this interface.
Whenever there is a request to a servlet or jsp, servlet container parses the incoming request, prepares a request object and passes it to service method.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, welcome to the ranch, psachin joshi!

If you start looking you'll see you do this kind of thing all the time. Say you write a method:

When somebody calls that method, you don't know what kind of List they will pass. It might be a familiar one from the Java library, or some totally new List implementation they made up. That's the goodness of abstraction: you can ignore the parts you don't need to know about and focus on the parts you do need. For example, you know the List will give you an Iterator but you don't have to know how it works.
 
paritosh ranjan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It really makes the task easy as you don't need to explore the request object to get the parameter you need.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!