Originally posted by gadipe kris:
Hi,
In the form tag of html we have the action attribute, where we specify the resource to be invoked, when we submit the form.
And generally we supply a Servlet or Jsp here.
And when we click submit button the request will be sent to the server, where the corresponding servlet object is created.
My requiement is to time the Call to a servlet or jsp such that it should be called only after a specific period of time.
Say for example 15 seconds or 20 seconds etc.
Can anyone plz help out.
Thanks in advance.
Kris.
********************************
import java.io.*;
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 {
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
res.setHeader("Refresh", "10");
out.println(new Date().toString());
}
}
try this.