A context path in Apache Tomcat refers to the name of the website as presented by the browser. For example, imagine I tell you to enter "localhost:8080/DemoWebsite/DateJSP.jsp" in your browser. The context path is "DemoWebsite". The term "context" in Tomcat is in fact synonymous with "website". The default context path can be specified if we provide a context file to Tomcat that is given the same name as the website. In this topic, you will learn how to accomplish this important task.
To learn how to set the default context path in Apache Tomcat in a Linux environment, follow these 9 steps:
DemoWebsiteunder the root (i.e., / ) of the file system.
DateJSP.jspin this folder. This file was created in the following topic:
<Context path="/Placeholder" docBase="/DemoWebsite" />
pathattribute value. The
pathattribute is only used by Tomcat if a context is placed in
/DemoWebsite/DemoWebsite.xml. This is not a required location, but will prove convenient for referencing the file in the future.
http://localhost:8080/DemoWebsite/DateJSP.jspand submit that address to the browser.