Servlet - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Servlet

skanhuskanhu Posts: 2Member
import javax.servlet .*;
import java.io.*;
public class HelloworldServlet implements Servlet
{
public void Servlet(ServletRequest request, ServletResponse response) throws IoException, ServletException
{
response.setcontenttype( text/html );
printwriter out = response.getwriter() ;
out.println("");
out.println("");
pout.println("

HelloWorld

");
pout.prinlnt("");
out.close();
{
public void init(ServletConfig config) throws servletexception
{
}
public void destroy()
{
}
public string getServletInfo()
{
return null;
}
public ServletConfig getServletConfig()
{
return null;
}
}}}


Comments

  • manishamanisha Posts: 32Member

    Nice Code.

    I would like to share some information on servlet.

    Servlet is a server side program which supports request response model. I is used to generate dynamic requests and used to serve the client requests.

    There is web container which is responsible for calling the appropriate methods of servlet like init(), service() and destroy() etc.

    For more Details Refer following link:
    http://java.meritcampus.com/t/75/Servlets?tc=mm242

Sign In or Register to comment.