I built a myjsp directory under $tomcat/webapps/as the default directory for my site, there is a a.jsp file in myjsp, which is the default home page for my site.
To modify a configuration file:
First, modify the $tomcat/conf/server.xml file. In the Server.xml file, there is a section as follows: ...
<engine name= "Catalina" defaulthost= "localhost" > Xmlvalidation= "false" Xmlnamespaceaware= "false" > ... To add between <context path= "" docbase= "myjsp" debug= "0" reloadable= "true"/>
Path is the name of the virtual directory, if you want to enter only the IP address to display the home page, the key value is left blank;
Docbase is the path to the virtual directory, it defaults to the $tomcat/webapps/root directory, and now I have a myjsp directory under the WebApps directory, which is the default directory for my directory.
Debug and reloadable are generally set to 0 and true respectively.
Then, modify the $tomcat/conf/web.xml file. In the Web. xml file, there is a paragraph like this: <welcome-file-list>
<welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> < ;welcome-file>index.jsp</welcome-file> </welcome-file-list>
Add between <welcome-file-list> and <welcome-file>index.html</welcome-file>:
<welcome-file>a.jsp</welcome-file>
Change Port <connector
port= "8080"
Maxthreads= "minsparethreads=" 25 "
Maxsparethreads= "enablelookups=" false "redirectport=" 8443 "
acceptcount= "debug=" 0 "
connectiontimeout= "20000"
Disableuploadtimeout= "true"/>
Change port "8080" to your ports
After saving the two files above, restart Tomcat and enter "http://localhost:8080/" in the browser address bar to display the contents of the a.jsp page.
Changing the tomcat default directory + port + setting Default Web page method