// Extend HttpServlet class
public class DateRefresh extends HttpServlet {
- //private java.util.Date d;
- //private Integer count;
-
public void init() throws ServletException {
// Do required initialization
- //d = new java.util.Date(); // DateRefresh at init time, do not change
- //count = 0;
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
response.addHeader("Refresh", "1");
// Actual logic goes here.
- //count++;
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("Date " + new java.util.Date().toString());
- //out.println("<br>");
- //out.println("GET call number " + count);
out.println("</body>");
out.println("</html>");
}
public void destroy() {
- //count = 0;
}
}