1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

servlet code to print date

Discussion in 'Java' started by angad_aks, Feb 16, 2011.

  1. angad_aks

    angad_aks Banned

    Joined:
    Feb 15, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DATE extends HttpServlet
    {
         public void doGet(HttpServletRequest request, HttpServletResponse          response)throws ServletException, IO Exception
         {
            PrintWriter pw=response.getWritet();
            Date today= new Date();
            pw.println("date is");
            pw.println(today);
          }
    }
    
     

Share This Page