Client pull is similar to redirection, with a major difference: the browser actually displays the content from the first page and waits some specified amount of time before retrieving and displaying the content from the next page. It’s called client pull because the client is responsible for pulling the content from the next page.

Client pull information is sent to the client using the refresh HTTP header. The header value specifies the number of seconds to display the page before pulling the next one, and it optionally includes a URL from which to pull, if no URL is given the same URL is used.


import java.sql.Date;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ClientPull extends HttpServlet{
    public void doGet(HttpServletRequest req,HttpServletResponse res)
            throws ServletException,IOException{
        PrintWriter out= res.getWriter();
        out.println(new Date().toString());
Parent Category: Java EE Tips