How do i run a sample hello world app in tomcat?



  • Apache Tomcat documentation link for sample app: https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/

    The instructions are already explained at the link above.

    The sample.war file is a self contained app, that demonstrates JSP - Java Server Pages and Servlet functionality.

    The sample.war file is moved to you /tomcat_install_dir/webapps and then got to the URL: https://<tomcat_server>:8443/sample

    It should look like this:
    0_1552336064008_tomcat_demo_app.png

    jar is a command to view the contents of the sample.war

    The sample app contains the following files:

    $ jar tvf sample.war 
         0 Mon Jul 30 17:18:12 PDT 2007 META-INF/
       106 Mon Jul 30 17:18:10 PDT 2007 META-INF/MANIFEST.MF
         0 Mon Jul 30 16:26:28 PDT 2007 WEB-INF/
         0 Mon Jul 30 16:26:30 PDT 2007 WEB-INF/classes/
         0 Mon Jul 30 16:26:30 PDT 2007 WEB-INF/classes/mypackage/
         0 Mon Jul 30 16:26:28 PDT 2007 WEB-INF/lib/
         0 Mon Jul 30 16:26:28 PDT 2007 images/
      1480 Mon Jul 30 16:26:30 PDT 2007 WEB-INF/classes/mypackage/Hello.class
       813 Mon Jul 30 16:26:28 PDT 2007 WEB-INF/web.xml
       376 Mon Jul 30 16:26:28 PDT 2007 hello.jsp
      1441 Mon Jul 30 16:26:28 PDT 2007 images/tomcat.gif
       636 Mon Jul 30 16:26:28 PDT 2007 index.html
    

Log in to reply
 

© Lightnetics 2024