Simple Helloworld Servlet Example Program

In this tutorial we learn how to write a Simple Helloworld Servlet Example Progaram and how to run that servlet in Tomcat which is integrated with eclipse.

1. Create a dynamic project in eclipse.

        Create a dynamic web project in eclipse(click “new” ->Dynamic web project) and add below servlet class to project

2. Write the Servlet class, HelloWorldServlet

 3. configure the servlet in deployment descriptor i.e in web.xml

 4. deploy and run the servlet in server.

Right click on the project and click on “Run As” -> “Run on Server”.

OUTPUT :   

helloworldservletoutput

See the video tutorial for above program.

Download  Source Code

 

Posted in servlets and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">