servlet basic

Discussion in 'Java' started by Manojbijnori, Jul 28, 2010.

  1. Manojbijnori

    Manojbijnori New Member

    Jun 16, 2009
    Likes Received:
    Trophy Points:
    Lecturer In Computer Science Department In Enginer
    tell me the method of running the servlet program on Tomcat6.0

    whole procedure
  2. fourthdimension

    fourthdimension New Member

    Jan 8, 2009
    Likes Received:
    Trophy Points:
    Home Page:
    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.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice