GTU WTAD Practical 10 : Write a Servlet to display ‘Hello World’ on browser

GTU WTAD Practical 10 : Write a Servlet to display ‘Hello World’ on browser

GTU WTAD Practical 10

This program is very fist program for you to execute Java Servlet. Lets called it HelloWorld using Java Servlet. First of all i would like to recall my previous article that gives complete explanation of the how to setup the environment variable to execute your Java Servlet programs. Once you are ready with environment setup you are ready to execute your first program. Steps to execute your first Servlet Program.

Step 1 : Write your your code in HelloWorld.java file as provided.

Step 2 : Compile HelloWorld.java using javac command and save the .class file to  Tomcat_Apache\webapps\gtu_10\WEB-INF\classes

Step 3 : Write down web.xml file as provided content and save it to Tomcat_Apache\webapps\gtu_10\WEB-INF\

Step 4 : Write down index.jsp and save it to root folder

Step 5 : Restart your server and open following url to execute your first Servlet

Step 6 : Drop thanks email to me !

File Name : index.jsp

File Location : Tomcat_Apache\webapps\gtu10\

 

File Name : HelloWorld.java

File Location : Tomcat_Apache\webapps\gtu10\WEB-INF\classes

 

File Name : web.xml

File Location : Tomcat_Apache\webapps\gtu10\WEB-INF\

 Output

GTU WTAD Practical 10

 

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative