How to run a servlet program?

Answer Posted / kunal sagar

first we con compile the java code throught javac compiler.
then,its .class file will be created that .class file copy
and paste the in the directory
c:/program files/apache/tomcat/webapps/servlet/web-inf
/classes.
then back one step backward
change the servlet code with ur file name
and also sevlet mapping code with ur file name
save that file
then open explorar
and type the local host address

Is This Answer Correct ?    18 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the workflow of a servlet?

939


Why is http protocol called as a stateless protocol?

765


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

878


Differentiate between get and post?

913


What is the inter-servlet communication?

949


What are the types of protocols supported by httpservlet ?

967


What are the differences between forward() method and sendredirect() methods?

797


How many objects of a servlet is created?

1029


Why do we need a constructor in a servlet if we use the init method?

760


What is the difference between Difference between doGet() and doPost()?

1000


List some life cycle methods of a servlet.

811


What is servlet mapping?

785


What do you mean by cgi and what are its drawbacks?

751


What are the type of protocols used in httpservlet?

836


Is servlet synchronized?

832