You are on page 1of 3

Steps to Execute a Servlet Application

1.Compile your servlet program ensure that the .class file is created successfully

2.Create your Web-Application folder, this folder should be created under webapps folder of Tomcat C:\Program files\Apache Software Foundation\tomcat5.0\webapss\MyProject Here MyProject is the name of your web-application folder

3. Create WEB-INF folder under your web-application folder

4. Next create classes and lib folder under WEB-INF folder. And also Create web.xml under WEB-INF.

5. Copy the servlet class file to the classes folder

6. Edit web.xml file to include servlets name and url pattern

7. Start the tomcat Server

8.Open the browser and type the following http://localhost:8080/MyProjects/URLofservlet and press Enter

Steps To Execute a JSP Application 1)Write the JSP page and save it with .jsp extension in MyProjects directory.That is JSP files and WEB_INF will be in the same level;

2)Edit the web.xml file as follows <web-app> </web-app>

3)Start the Tomcat Server

4)Opene the browser and type the URL http://localhost:8888/MyProjects/filenameofjsp and press enter.

In Tomcat we will find the corresponding generated .java file in the following location Tomcat5.0/work/catalina/jsp1/org/apache/jsp

You might also like