How to run a servlet program?

Answer Posted / giridhar gangapatnam

Sampleapplication
-- any html or jsp pages
-- WEB-INF
--web.xml
--lib(which contains any jar files)
--classes
--(all Servlet .class files)


After compilation of Servlet .java files start the Tomcat
Server and in URL type like:
http://localhost:8080/Sampleapplication/.html(or).jsp <--(enter)

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

515


Tell us something about servletcontext interface.

626


What are the annotations used in servlet 3?

574


What is the difference between context parameter and context attribute?

531


What is servlet initializer?

500






What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

563


If a servlet is not properly initialized, what exception may be thrown?

623


How many servlet objects are created?

561


What is war file?

578


Explain the lifecycle of a servlet?

503


How does java thread pool work?

546


What is servlet and its use?

623


What is http servlet?

579


How native code can be used in a servlet?

3518


What is a servlet engine?

544