Is it compulsory to have one's application immediately under webapps directory? I want to have my application to be accessed as http://localhosts:8080/a/b/Servlet, where a is under webapps and b is in a.
Some previous discussions at this place have given some solutions and they do not work. For example, Configure Tomcat 6 to serve applications in other than default directory, does give one solution and it does not work. While starting, Tomcat 6.0.14, it gives serious error.
It is compulsory to have a well formed application directory structure (there has to be a 'WEB-INF' directory in the root of your application.
As long as you have a proper directory structure, you can configure Tomcat to deploy it from any directory that it can see.
To do this, you can add a <Context .../> entry to your server.xml (old way) or create a context fragment file in tomcat/conf/Catalina/localhost with the <Context .../> tag in it (best practice). With either approach, just add a the path to your app in the docBase attribute.