Skip to main content

Featured

Game Development Tutorials In Android

Game Development Tutorials In Android Hi Guys,                 We are shortly started Game Development Tutorials in Android Studio. So everyone supports me and share this blogs to your friends. Guys, At this time everyone is freely available to source code and we are provide a video for step by step game developments. you are learn free and feel free to support us. Guys, if you have any question to me, so feel free to comment us. I will try to answer all the question as long as possible.                                                     Thank's                                                                          ...

Date Function in Servlet Example

Date Function in Servlet Example


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

public class HelloDate extends HttpServlet
{
   public void doGet(HttpServletRequest res, HttpServletResponse rep) throws IOException, ServletException
   {
      rep.setContentType("text/html");
      Date date = new Date();
      PrintWriter out = rep.getWriter();
      out.println("<html><head><title>Welcome</title></head>");
      out.println("<body>"+date.toString+"</body></html");
   }
   public void destroy()
   {
       //Do Nothing
   }
}


web.xml


<servlet>
   <servlet-name>HelloDate</servlet-name>
   <servlet-class>HelloDate</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>HelloDate</servlet-name>
   <url-pattern>/HelloDate</url-pattern>
</servlet-mapping>
 
Now Compile and Run On this Program for better understanding, if you have any question about this program feel free to comment below. And don't forget to follow our blog.
  If this information is important to you , and you want to , I will continue writing some more details About Java, Servlet's, Android Programming Language, so click on the advertising, available on this page. This is motivate me for writing some more useful stuff, Thank's

Comments