1.tomcat the original default root directory is http://localhost:8080, if you want to modify the root directory of access, you can:
Locate the Tomcat Server.xml (under the Conf directory) and find:
<name= "localhost" appBase= "WebApps" Unpackwars = "true" autodeploy= "true" xmlvalidation= "false" Xmlnamespaceaware = "false" ></ Host >
Insert before </Host>:
<path= "" docBase= "d:/eclipse3.3/jb51.net/tomcat/" Debug = "0"/>
Where d:/eclipse3.3/jb51.net/tomcat/is the Web root directory that I want to set up, and then reboot Tomcat.
When you visit http://localhost:8080 again, you are directly accessing the files in the d:/eclipse3.3/jb51.net/tomcat/directory.
2.tomcat Web. XML (in the Conf directory), found in the file
<welcome-file-list> <Welcome-file>Index.html</Welcome-file> <Welcome-file>Index.htm</Welcome-file> <Welcome-file>index.jsp</Welcome-file> </welcome-file-list>
This is the default 3 files for Tomcat, and when you enter a specified path, Tomcat will automatically find the 3 pages. If you want Tomcat to automatically find its own page, such as main.jsp. The above information can be modified to:
<welcome-file-list> <Welcome-file>main.jsp</Welcome-file> <Welcome-file>Index.html</Welcome-file> <Welcome-file>Index.htm</Welcome-file> <Welcome-file>index.jsp</Welcome-file> </welcome-file-list>
That's all you can do.
Change the configuration method for the site root and default page in Tomcat