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 are the types of Session Tracking ?

646


How does java thread pool work?

546


Write a program to show the functionality of servlets.

553


Define the life cycle of a servlets.

572


Why is init() method is used in servlets?

554






Whats the advantages using servlets over using CGI?

584


Elucidate servlet attributes and its scope?

567


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

546


What is the use of httpservletresponsewrapper?

530


What is the major difference between servlet and applet?

540


Can we get PrintWriter and ServletOutputStream both in a servlet?

656


What is the difference between 2 types of servlets?

642


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

644


What are the steps that are required to handle the multi-threading?

593


Explain the difference between servlet and cgi?

605