Why is HttpServletRequest an interface?

I am looking at Servlets for the first time and am getting a little confused. HttpServletRequest is an interface according to the J2EE API but the API says that the container creates HTTPServletRequest objects. How can you instantiate an interface? How does the container create HttpServletRequest objects associated with the request? Why does it not use HttpServletRequestWrapper?

An interface is actually not to be instantiated, but to be implemented. An interface is just a blueprint how the actual implementation should look like at least.
In this case, it's up to the business logic of the applicationserver how to implement it. Generally each appserver has it's own implementation of the HttpServletRequest. But because you can declare it to the HttpServletRequest, you can use it the same way anywhere, unless at which appserver you deploys the application.

Similar Messages

  • Why choose an audio interface over a mixer?

    I know there are tons of question out there who are quite similar to mine, but yet none of 'em seem to be able to solve my question.
    The main question I'm asking is: what's the difference between a mixer (either w/ or w/o built in audio interface) and an external audio interface?
    But the answers to this exact question weren't sufficient because I ran into a practical problem, wich is as follows:
    A friend of mine uses his Behringer XenyX 802 mixer as a way to input the signals his mic's send into GarageBand/Logic (kind of DAW is irrelevant). Now i've been wanting to set up my own little home studio myself and basically every tutorial/video out there says: "in order to record multiple instruments into your Mac, you need an audio interface." Now I don't get exactly why, because i've seen someone do it with a mixer. I assume that the mixer in question has a built in audio interface (since it has, amongst other features, phantom power), so it's not neccesary to have an audio interface, or is it?
    Then I started searching the web for different audio-interfaces because I thought: "well they must know what they're talking about. So I guess I have to start looking for an interface." I found that a lot of interfaces <€100 have only 2 inputs, mostly an XLR input and a Jack/instrument input. One of the most popular beign the Avid Fast Track MK II USB interface. I happen to know that the Xenyx 802 has 2 XLR inputs AND 2 jack inputs and I can get my hands on one (2nd handed version) for about half the price of the Fast Track. I thought to myself: "why? Why do all those 'experts' who explain it in video's tell me to specifically get an interface?" this is because I found that the more input channels you want from an interface, the higher the price.
    Can anyone help me explain why the Fast Trak MK II is twice as expensive as the Xenyx 802 while it offers half the amount of inputs?
    Thanks

    Cyclone13 wrote:
    Thank you for your response, it helped quite a lot. Just to make sure if I understand correctly:
    You can only record 2 instruments simultaneously at max using a mixer (on their own track, because I have seen it done before), but you would be able to record, say, 6 mic's at the same time if you had the proper interface (an interface with at least 6 inputs and outputs that is). Now the M-Audio has only two inputs I believe, and therefor I take it has a stereo output as well, so the maximum simultaneous recording for the fast track is 2, just as that of the Behringer?
    Regarding the Mixer... The Behringer you posted is just a standard Mixer, it doesn't have USB output, in which case you have to use the Mac's audio system (the Line-Input) and run a cable from the Mixer's main or monitor outs into the Mac's Line input. Computers use inexpensive audio chips that do not provide the greatest sound.
    I thought you were talking about this Behringer:
    http://www.amazon.com/Behringer-Xenyx-Q802USB-Audio-Mixer/dp/B008O517IC
    It is a mixer and an audio interface rolled intro one.
    The M-Audio is a true separate Audio Interface that provides it's own Inputs and Outputs, (Like the USB Behringer).
    Regardless, all three, the Behringer stand alone mixer that uses the mac's audio, The Behringer with the built-in stereo USB audio interface and the M-Audio with USB interface are all stereo units. The USB audio interface will only show two inputs and a stereo out. The most you can record separately on either is 2 instruments.
    Here is one step up:
    http://www.motu.com/products/motuaudio/audio-express
    The MOTU unit has 4 analog inputs as well as a stereo digital input.
    The next step is an interface like this with 8 Mic inputs. It would show up in Logic as 4 stereo pairs or 8 individual inputs. You could use 4 mics on a set of drums, 1 for guitar, bass direct, stereo input for keys and record everyone playing at the same time on 8 separate audio tracks giving you full control (in Logic) of the final mix.        http://www.motu.com/products/motuaudio/8pre

  • Why not a LinkedMap interface for LinkedHashMap?

    I`m currently cleaning my null-rejecting collection framework and I found the LinkedHashMap in the Collection framework. Why doesn`t this class have an interface LinkedMap? The autor of the class, Joshua Bloch, tells in his 'Effective Java: Programming Language Guide' to use interfaces to design from. Why did he not do this himself??

    Just because LinkedHashMap exactly implements Map and nothing more. What would be the benefit of an extra interface LinkedMap, which would most likely extend Map and add nothing more?

  • Why JDBC has mainly interfaces ?

    Hi,
    I was studying JDBS when a thought came to my mind.
    I can see mainly interfaces in JDBC, like the Statement interface,Connection Interface etc.Whys such a architecture?
    Can anyone let me know...
    With Regards

    The interfaces provide a known API that you the user can write your code against.
    The driver implementor (usually the database vendor) can then do whatever's necessary to support that interface.
    There are only a few classes in the spec because:
    * Most of the "hard" stuff tends to happen IN the database itself.
    * DB Vendor protocols tend not to have much in common.
    * The interfaces minimise the constraints placed upon the vendors when creating their implementations.

  • Why does TS Operator Interface Resource file not update panel labels correctly?

    There seems to be a problem with TS1.0.2 with the retrieval of Resource strings. If there are other INI files in the Components\User\Language\English directory other than the "OperatorInterfaceStrings.ini" file, the default operator interface seems to randomly use other files when attempting to get the resource strings to update my panel labels. The problem occured when I created a copy of the original "copy*.ini" file and my OI kept using the text values from the old file even after closing the OI and restarting it. Would like to know why.

    Hi Todd,
    In the \User\Language\English directory should be a file called CustomStrings.ini.
    Put your additional Resource strings in this file and keep your default ini files unaltered in the \NI\.. folder.
    Follow the structure as per the default inis and as per the user manual.
    This should sort your problem out.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Why has itunes user interface been ruined?

    Why has the itunes user interface been ruined?  It used to be easy to use.  Basic functions dont work any more.  Editing a Play List requires extra steps.  I cant restore the useful side navigation bar where I could easily add a song to one or more play list...
    Incredibly frustrating.

    When I plug the iPhone in the sync options comes up once, but once you leave you cant get it back.  There is phone icon in the top icon nave bar - but clicking on it does nothing.  What is the point of the icon if it does nothing?
    How do you get back to the sync options screen where you can select the music you want without having to disconnect and plug it back in again?
    It used to be easy...  More frustration...

  • Why does the sensing interface flap or frequently go to the down state in IDS ?

    Hi all,
    this is the answer I found in Cisco website, but according to this, I didnot make any updates or any configuration changes, but stilll my sensing interface is going down. I'm not even getting the error messages which they have mentioned at the end.
    Ans: During a signature update and reconfigurations, sensorApp stops to process packets as it processes the new signatures in the update. The network driver detects that sensorApp has stopped and pulls any new packets from the buffer. So the network driver does different things, which depends on the configuration and sensor model:
    Promiscuous Interface—It brings the link down on the interfaces, and brings the link back up once sensorApp starts to monitor again.
    Inline Interface or Inline Vlan Pair—It depends on the Bypass setting:
    Bypass Auto—The driver keeps the link up and begins to pass packets through without analysis. It then reverts back to sending the packets through sensorApp once sensorApp starts to monitor again.
    Bypass Off—The driver brings the link down on the interfaces, which is the same as in promiscuous mode, and brings them back up once sensorApp starts to monitor again.
    So, if sensor app does not pull packets from the buffer, which possibly occurs because there is no interface configured to process packets, then the driver can put the interface in a down state.
    These logs are seen when the sensing interface flaps:
    28Jun2011 09:03:09.483 6050.885 interface[409] Cid/W errWarning Inline databypass has started. 28Jun2011 09:03:13.639 4.156 interface[409] Cid/W errWarning Inline databypass has stopped. 28Jun2011 09:19:23.922 970.283 interface[409] Cid/W errWarning Inline databypass has started. 28Jun2011 09:19:27.486 3.564 interface[409] Cid/W errWarning Inline databypass has stopped.

    It is possible you are overloading that little 4215. If that is the case you should also be seeing "missed packet percentage" messages in your events.
    How much traffic is your 4215 getting? Those sensors will start to drop packets for inspection at about 30 Mb/s.
    - Bob

  • Why is the tethering interface for iPhone5 ordered from Apple not in the Settings app while an iPhone5 ordered from Verizon does have the tethering setting present?

    My girlfriend and both bought iPhone5's and are on the family plan. I bought mine through the Apple store and she through Verizon directly. In her settings app the tethering interface is present, in mine it is not. Anyone how to or know who to contact to get my phone purchased through the apple store to get this enabled.

    Contact Verizon & make sure Tethering is provisioned on your account. That setting won't appear if it's not.

  • Why we need externalizable interface in java

    Hi friends,
    I know the Concept of serliazation and externalization, apart from this concept i have one doubt about externalization, I feel both are doing same work. Then what is the nedd of externalizable interface. Can anyone tell what is the difference of Serialization ans Externalization, if both are doing same work.

    Crosspost: http://forum.java.sun.com/thread.jspa?threadID=5226495&tstart=0
    Don't crosspost, it's rude and a waste of time and energy for all involved.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Why is my user interface monitor resolution dependent?

    The user interface I created with Labview is screen resolution dependent. That means I built a user interface application exe on my computer. But when I run the exe on another computer with lower resolution, the application window was enlarged and some of the controls were cut off. I have had the problem all the time and it bacame a famous issue in our engineering group . By the way, I didn't check any box in the VI Property\Window Size window. Can you help me to fix this problem?

    I use Labview 7.1.1 and had this issue, the fix is under VI Options.. goto Window Size and check "Maintain proportions of window for different monitor resolutions", there is also a check box for "Scale all objects on panel as the window resizes".
    Give these a try they should work for you.
    Andrew Alford
    Production Test Engineering Technologist
    Sustainable Energy Technologies
    www.sustainableenergy.com

  • Why is my apps interface in french now?

    I updated my ios to 6.1.3 and now my apps interface is in French.
    How do I get it back to English?

    Are you in the French store? Look here:
    Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.

  • Why doesn't firefox interface with egames when it did before this update?

    Before updating Firefox 4.0, I was able to receive, download and play games from egame.com. Now I am having problems with doing this. Will this problem be fixed soon or can I delete 4.0 and go back to the earlier version that worked well with egames?
    AbbyT

    Hello AdzoRose, it is sad but the metro version of firefox has been cancelled, see : https://blog.mozilla.org/futurereleases/2014/03/14/metro/
    thank you

  • Why to use Interface if methods are not implemented??

    Hello,
    I am having a problem to clearify as, why to use the interfaces which defines only methods and no implementation??
    When a class implements an interface the methods are implemented by the class itself, don't you think that the same functionality can be achieved if the class defined the method itself...
    The why to use interfaces, just that the same method name can be used by many classes or some other reasons..

    did you google on that? There is lots of information I am sure explaining why you code to an interface defined type rather than a class defined type.
    However, fundamentally you are correct, classes define their own type. The idea is that you use an interface because it allows you to have more than one implementation. Plus you can more easily change the structure of your program if you later wish if you did not use the class type directly.
    You get better answers if you ask in the Patterns forum below.

  • Why Interface is necessary in Java?

    Hi,
    we know interface is like a skeleton, that contains only method signatures and variables. Methods must be public, abstract and variables must be public static final.
    simply we are implementing interface and defining all the methods in our class. we can do this without going to interface.
    why we have this interface? please explain me with simple real time example.
    Thanks and Regards,
    Periyasamy

    simply we are implementing interface and defining all
    the methods in our class. we can do this without
    going to interface.Huh?
    why we have this interface? please explain me with
    simple real time example.Do you mean "real-life"?
    Example
    There is no specified implementation type of the return value, and neither should there be one, so it can be easily replaced.

  • Why iterator is interface

    hi,
    why iterator is an interface and not a class.
    Thanks,

    Iterator is set up as an interface so that you may define iterators of your own for your own classes. Let's assume you create some class MyClass. If this class does not directly extend a class that has a method to return an iterator you would need to define one yourself. So you could create a class MyClassIterator that implements Iterator. Then in MyClass you can add a method as follows:
    public class MyClassIterator implements Iterator
    MyClass obj = null;
    public MyClassIterator(MyClass obj) { this.obj = obj; }
    public boolean hasNext() {...}
    public Object next() { ... }
    public void remove() { ... }
    public MyClass
    public Iterator iterator()
    return new MyClassIterator(this);
    }

Maybe you are looking for

  • Customer Downpayment Update in Project Infosystems

    Hi, I am facing problems w.r.t. update of customer down payment in project info systems. As per standard SAP, after doing customer down payments, this will get updated in project info systems (CN41/CN41N). Please suggest me to fix the issue. Best Reg

  • Z10 opens new emails at start up.

    When I turn my phone on in the morning, any new emails that come in will automatically be open. It only happens when the phone is turned on. Any emails after that aren't opened. Is there a setting somewhere to change this.

  • BSOD may occurs when hibernating by Intel WiFi driver on Windows 7 x64

    I use Thikpad X201s (5129CTO). BSOD has occured today. The content of the event log is shown in the following. - System - Provider [ Name] Microsoft-Windows-Kernel-Power [ Guid] {331C3B3A-2005-44C2-AC5E-77220C37D6B4} EventID 41 Version 2 Level 1 Task

  • I want to change my description label from HONOR STUDENT. How?

    I want to change my description label  from HONOR STUDENT. How?  Also, why are there extraneous characters like commas, in my 'handle' field as you read through forum entries? I see a lot of complaints about unsolved issues, but most people know you'

  • Network was reset error when attempting to buy in store

    I'm trying to purchase the "Pokemon HeartGold & SoulSilver Soundtrack" but everytime I try it says that the network connection was reset. Last night I tried buying something else, a single song from an unrelated album, and that went through, but stil