• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

interfce and implementation of method

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I think I'll just lie down here for a second. And ponder this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic