Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the default program release path for Tomcat

2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to modify the default program distribution path of Tomcat. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The default program release path for tomcat7 is under tomcat/webapps/ROOT/.

Examples

For example, if I create a new jsp file under the tomcat/webapps/ROOT/ path, I can directly use URL to:

Http://localhost:8080/index.jsp

To visit.

For example, when I upload and download files, I can create a new FileUpload folder under ROOT, set the path of uploading files to this folder, and then upload a file test.txt; for download function. When I click the download button of the file, you can directly let the web page open a URL:

Http://localhost:8080/FileUpload/test.txt

Modify

Open tomcat/conf/server.xml with the following code:

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

Where path is the name of the virtual directory, as long as you enter the IP address to display the home page, docBase is the path of the virtual directory, the default is tomcat/webapps/ROOT/, we modify to docBase= "example", then example and ROOT have the same function!

Mission success

Thank you for reading! This is the end of this article on "how to modify the default program release path for Tomcat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 252

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report