Web tier: servlets, JSP, Web frameworks: Help Me in Writing and Deploying my First JSP in Tomcat 5.0

  1. Dear Friend,
               Please help me in Writing and Deploying My First JSP in Tomcat 5.0 on Windows 2000.
                I am looking for a sample directory structure and the steps in doing every sub task.
    Thanking you,
    Best Regards,
  2. Hi Bhaskar,
                 Deploying on Tomcat5.0 is easy enough if you have prior experience in deploying in other web-containers by other vendors.
                 You can for starters have your own directory created under the "webapps" folder and save your .jsp there.
                 You can then bring up the server and then type http://localhost:8080/<your directory name>/<your JSP Name>.jsp .You will find the output displayed on your browser.

    For example:http://localhost:8080/MyJsp/Example1.jsp

    Hope it helps!!
  3. I tried exactly what you said before as well.
    My dir:
         C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\MyJSPs
    and I have my jsp file in that called "One.jsp".
    After starting my server,
          I entered the following in my web browser(IE 6.0).
         My Server is configured for 8086(I changed in server.xml and other example JSPs are working)
           I entered with the exact case as JSPs and directories are case-sensitive.
      Now, I get an error (as before):
          404-NOT Found!!!
    Please help!!!
    Thanks and Best Regards,
  4. Context[ Go to top ]

    Inside the <HOST></HOST> tags in your server.xml, include the following Context tag:

    <Context path="/MyJSPs" docBase="MyJsps" debug="0"/>

    You should be able to paste that line under the

            <!-- Tomcat Root Context -->
              <Context path="" docBase="ROOT" debug="0"/>

    section you'll find 2/3's of the way down the server.xml file.