The default program publishing path of tomcat7 is tomcat/webapps/ROOT/. example For example, if I create a jsp file in the tomcat/webapps/ROOT/ path, I can directly use the URL:
Come visit. For example, when I do file upload and download functions, I can create a new FileUpload folder under ROOT, set the path of the uploaded file to this folder, and then upload a file test.txt; when doing the download function, click the download button of the file to directly open a URL on the web page:
Revise Open tomcat/conf/server.xml, there is the following code: <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> name is the local access address and appBase is the parent address of the project, both of which can be modified. Add the following tags between the host tags <Context path="" docBase="example" debug="0" reloadable="true" /> Among them, path is the name of the virtual directory. As long as you enter the IP address, the homepage will be displayed. docBase is the path of the virtual directory. The default is tomcat/webapps/ROOT/. We change it to docBase="example". At this time, example has the same function as ROOT! mission success Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Detailed summary of MySQL and connection-related timeouts
>>: CocosCreator Universal Framework Design Network
Table of contents Hidden, descending, and functio...
What is NFS? network file system A method or mech...
Table of contents Overview Blob Blob in Action Bl...
1. Import csv file Use the following command: 1.m...
This article introduces the flex layout to achiev...
offset Offset is the offset. Using the offset ser...
The effect is very simple, just copy the following...
Using the clear property to clear floats is a comm...
Preface: When we are making web pages, we often n...
This article uses the element official website an...
Core code -- Below I will demonstrate the impleme...
As the company's influence grows and its prod...
MySQL Introduction to MySQL MySQL was originally ...
Border Style The border-style property specifies ...
Table of contents introduction Install Homebrew I...