servlet basic

Manojbijnori's Avatar, Join Date: Jun 2009
Go4Expert Member
tell me the method of running the servlet program on Tomcat6.0


whole procedure
0
fourthdimension's Avatar, Join Date: Jan 2009
Ambitious contributor
Without an ide (as well as I can remember):

1. Write your servlet.
2. Download tomcat.
3. Put your servlet in the tomcat webapps folder under a folder named after your web app.
4. Inside that folder, create folders WEB_INF and WEB_INF/classes.
5. In the WEB_INF folder, create and populate web.xml with information on how to access your servlet. See the tomcat documentation for information on this.
6. Start up tomcat. Your servlet is now active on localhost:8080/servlet or however you listed it in the web.xml.

Using netbeans:
1. Create a new java web application project. When the wizard asks what server you want to use, choose tomcat 6.0. You may need to download a plugin from the plugin list if your netbeans didn't come packaged with this capability.
2. Code your servlet.
3. Populate the web.xml.
4. Right click on the project and click deploy.
5. Your servlet is now active on localhost:8080/servlet, or however you listed it in the web.xml.


Hope that helps some. I can give more specific details when I'm back on my development machine if you need more info.
shabbir like this