Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:14:35+00:00 2026-06-09T14:14:35+00:00

Take for example gmail.com where new mails are displayed as and when they reach

  • 0

Take for example “gmail.com” where new mails are displayed as and when they reach user’s inbox. As I’ve understood, the trigger comes from database/web-server which updates user’s inbox page.

Can anyone suggest what will be the code to update dynamic web-pages [assuming Gmail account page is generated by Servlet like technology] without refreshing & without making an explicit request from client side (please don’t consider XHR sending request to server at fixed interval because that too will be from client’s side).

Can it be implemented by AJAX code involving XHR & if yes,then how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:14:37+00:00Added an answer on June 9, 2026 at 2:14 pm

    I think the usual way to do this, at present, is with “long polling”, also known as Comet. There are various specific techniques, but the basic idea is that the browser sends a request to the server, and the server just keeps the connection open until it has something to send to the browser. On Gmail, for example, the browser app might immediately request the next new message in your inbox, and the server might wait half an hour before sending it because that’s how long it took for a new message to actually arrive in your inbox.

    Technically this is still client-driven, but the client’s “request” is really just offering the server an opportunity to send data to the client at a future time of its choice.

    When you use long polling, your server will have lots of pending requests sitting idle most of the time. Version 3 of the Servlet API introduced “asynchronous support“, which lets a thread put a request on hold and handle other requests while the first one waits. Servlets written for older API versions won’t scale so well, because the service() method mustn’t return until it’s produced the response, so it has to tie up a thread just waiting until it’s time to respond. Alternatively, Tomcat has a special extension for Comet which lets a servlet handle many requests at the same time on the same thread using event-driven I/O; other servlet containers may offer similar extensions.

    There’s a new protocol called WebSockets that allows two-way communication over a persistent connection without the overhead of HTTP, but it’s not widely supported yet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets take the example from Yelp: http://www.yelp.com/boston You can see that it's a website
Take for example the python built in pow() function. xs = [1,2,3,4,5,6,7,8] from functools
Take this example Proc: proc = Proc.new {|x,y,&block| block.call(x,y,self.instance_method)} It takes two arguments, x
I take an example from Fortran 95/2003 explained by Metcalf et al, since m
I take full advantage of GMail's wildcard feature (username+wildcard@gmail.com). Unfortunately it seems that most
Take for example: fsockopen(tcp:\\example.com, 80, $errno, $errstr, 5) My friend has just informed me
take this example from google docs class BrowseHandler(webapp.RequestHandler): > def get(self, category, product_id): >
Take the Gmail app as an example. Whether the phone is on or not,
I have a doubt regarding POJO. Take below example public class User { String
import imaplib import pprint IMAP_SERVER='imap.gmail.com' IMAP_PORT=993 M = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT) rc, resp = M.login('user@gmail.com',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.