File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Doubt regarding HttpServetRequest request reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Doubt regarding HttpServetRequest request reference" Watch "Doubt regarding HttpServetRequest request reference" New topic

Doubt regarding HttpServetRequest request reference

Hariom Tiwari

Joined: Jun 15, 2008
Posts: 10
Hi All,
In doPost/doGet method we call all methods on request/response, while they are references only and the methods being called are also abstract.
My understanding says methods can be called only on objects.
Please tell me the mechanism behind this behavior.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

HttpServletRequest is an interface. Something else implements it. In the case of servlets, it is the container that does this.

This is a fundamental concept in Java, you'll see it in all sorts of code. I'd recommend a read through of the Java Tutorial.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Doubt regarding HttpServetRequest request reference
It's not a secret anymore!