Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

HttpServlet API  RSS feed

 
Ranch Hand
Posts: 321
Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I am having 1 doubt regarding servlets and jsp.
the doubt is about the Interfaces in Servlet API and HttpServlet API.

suppose if I am having an HTML form having 2 fields, Username and Password.

I will capture those values in the servlet using

String Username = request.getParameter("Username")
and Password using
String password = request.getParameter("Password")

as we know, request is HttpServletRequest which is an Interface and since it is an interface, all the methods are unimplemented abstract methods, am I right?

and those methods need to be implemented somewhere in some classes?
can anyone help me to find the implementation of those methods?
and if implementation is not provided, how those methods provide the desired functionality?

and if the container provides the implementation, how does it do that? Which class inside the container provide the implementation of those interfaces?

Please help me out for this problem.

Help is always appreciated,

Thanks and Regards,
-Pankaj



 
author & internet detective
Marshal
Posts: 38502
653
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pankaj,
Your servlet container provides an implementation. For example, Tomcat.
 
Pankaj Shet
Ranch Hand
Posts: 321
Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh thanks a lot for such a prompt reply, jeane , but can you tell me which classes or which jar file inside tomcat provide those implementations?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 38502
653
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The nice thing about an interface is that I don't need to know that. If I wanted to find out I would call request.getClass() or set a breakpoint and check which implementation was provided.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!