1. I built a myjsp directory under $tomcat/webapps/as the default directory for my site, and in myjsp there is a a.jsp file that is the default home page for my site.
2. Modify the 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" >
unpackwars= "true"
xmlvalidation= "false" Xmlnamespaceaware= "false" >
...
</engine>
...
3. 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.
4. Then, modify the $tomcat/conf/web.xml file.
in the Web. xml file, there is a section as follows: <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>
5. Change the port (this step can be omitted)
<connector port= "8080" maxthreads= "All" minsparethreads= "" 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.
Modify the Tomcat welcome page to the homepage of your project