I normally don't use "control panel" apps to configure Tomcat myself, so I'm manually doing what those apps would do for me.
Every J2EE/JEE web application must be in the form of a WAR or EAR. Tomcat doesn't handle EAR format, so all Tomcat webapps must be in WAR form. The WAR (
Web
Archive) format is an extended form of the Java JAR file format, which in turn, is an extended form of ZIP file format. The standards-mandated WAR is a single file with a specific set of resources in it. Tomcat, like many other webapp servers also allows what's known as an "exploded WAR", which is simply a directory whose contents are the unzipped WAR file.
No matter how you deploy your webapps, regardless of whether it's via a master-control webapp like cPanel, the Tomcat Manager/Admin webapps, the
J2EE deployment API, or, like me, by brute-force file copying, the webapp
must be in WAR format.
Traditionally, a WAR always had a WEB-INF/web.xml file to configure it. In recent JEE specs, the web.xml file is optional, since newer webapp servers can scan class annotations and synthesize a web.xml, but the basic architecture remains.
Within a WAR, you can place JSPs anywhere, but if you place them under the WEB-INF directory, they cannot be accessed by clients via URLs. Otherwise, the convention is that the URL for a JSP within a WAR is mapped to the war's directory pathname of the JSP file.
So, if I create a WAR named "mywebapp", and deploy it using Tomcat's default deployment/configuration services, the JSP I've defined in the WAR at "/forums/messageEdit.jsp" would have a corresponding URL of "http://mytomcat:8080/mywebapp/forums/messageEdit.jsp".
If you interact with Tomcat deployments at the file level, you'll find that Tomcat has a "TOMCAT_HOME/webapps" directory. This is where WARs are located by default. The webapp's URL context path (for example, "/mywebapp") defaults to the name of the WAR. If I copy in a "mywebapp.war" file to TOMCAT_HOME/webapps, then Tomcat will detect it, unzip it to create a corresponding TOMCAT_HOME/webapps/mywebapp directory, and use that as the resource base (codeBase) of "mywebapp". Note that once Tomcat has created an exploded WAR, it will ignore any war file of the same name, even if you update or replace that WAR file. So to deploy a new version of the webapp, the exploded WAR has to be replaced or deleted.