I recently read about long-polling concept which can be used with http. I want to understand, if any http protocol standard itself supports long-polling concept, so that depending on how client configures the http connection, the server can behave in short-polling manner or long-polling manner, so in effect some clients can connect in short-polling mode and some clients can connect in long-polling mode.

Any sample code esp in java would be helpful.