How does the javax.servlet.http.HttpServletRequest Interface work?

Posted on 2000-01-12
Medium Priority
Last Modified: 2010-04-01
If this really is an interface, then its methods should be abstract and have no implementation. And yet when i call request.getParameters(String);
then I recieve a result. Where is the implementation for this method, or what mechanism are they using to implement it?

Question by:blairdye

Accepted Solution

_lychee_ earned 200 total points
ID: 2345319
an interface is a way of specifying a particular set of methods a class must have... thus, if u say that request is of the type HttpServletRequest, it just means that the object that request points to fulfills that particular contract... if u have an object at hand, it already implements all the methods it 'needs'...

so to ur qn, the implementation for this method is in the class that the object is of (which u can get at by looking at request.getClass())...

Expert Comment

ID: 2551442
I still don't understand what you are talking about!

Would you give us an example?


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question