In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to set up the Web service directory on the Tomcat application server". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to set up the Web service directory on the Tomcat application server.
Article catalogue
Preface
1. Set the root directory of Web service
1.1.1. Default access address of the root directory (set IP)
1.1.2. Default access address of the root directory (IP is not set)
1.1. Location of the root directory
2. Set the Web service directory under webapps
3. Create a new Web service directory
4. Set up relative directories
Preface
When we use web server Tomcat for web page deployment, when we do not configure other IDE (such as Eclipse), we need to configure the server's service directory ourselves, and the configuration of the service directory can be subdivided into several kinds. This article lists the following ways on how to configure. Hope that students who are beginners of dynamic pages and Tomcat servers can have their own understanding of the principle. We must save the written JSP file to a Web service directory on the Tomcat server so that remote users can access the JSP page on the Tomcat server through a browser. What people often say about a website is actually a directory of Web services.
First, set the Web service root directory 1.1, the location of the root directory
If the Tomcat server is installed in D:\ apache-tomcat-8.0.3, the root directory of Tomcat's Web service directory is: d:\ apache-tomcat-8.0.3\ webapps\ Root.
If you are going to visit the JSP page in the root directory, you can enter the Tomcat server's IP address (or domain name), port number, and the name of the JSP page in the browser (the name of the Web root directory must be omitted).
1.1.1. Default access address of the root directory (set IP)
For example, if the IP address of the Tomcat server is 192.168.1.100 and the name of the JSP page stored in the root directory is example1_1.jsp, what the user enters in the browser is:
Http://192.168.1.100:8080/example1_1.jsp1.1.2, default access address of the root directory (IP is not set)
If you have not set a valid IP address for the machine where the Tomcat server is located, to debug the JSP page, open the browser on the machine where the Tomcat server is located, and enter the following address in the browser's address bar, as shown in the following figure:
Http://127.0.0.1:8080/example1_1.jsp
2. Set the Web service directory under webapps
Any subdirectory under the webapps directory of the Tomcat server installation directory can be used as a web service directory.
We can create a new subdirectory under webapps, such as a ch2 subdirectory, and ch2 becomes a Web service directory. If you save the JSP page file example1_1.jsp in the Web service directory under webapps, you should enter the Tomcat server's IP address (or domain name), port number, Web service directory and JSP page name in the browser's address bar, for example, example1_1.jsp is saved to ch2, and the input is as follows:
Http://127.0.0.1:8080/ch2/example1_1.jsp
3. Create a new Web service directory
You can set a directory of the computer where the Tomcat server is located (not a subdirectory under webapps) to a Web service directory, and specify a virtual directory for the Web service directory, that is, hide the actual location of the Web service directory. Users can only access the JSP pages in the Web service directory through the virtual directory.
You can set up a new Web service directory by modifying the server.xml file in the conf folder under the Tomcat server installation directory.
Suppose you want to use D:\ MyBook\ zhang and C:\ wang as the Web service directory, and let users use the apple and cloud virtual directories to access the JSP pages under the Web service directory D:\ Mybook\ zhang and C:\ wang, respectively, first open the main configuration file: server.xml in the conf folder with notepad, find the part that appears (near the end of the server.xml file), and then add before:
Note: xml files are case-sensitive and should not be written as.
After the main configuration file server.xml is modified, the Tomcat server must be restarted. After restart, the JSP page can be stored in D:\ Mybook\ zhang or C:\ wang so that users can access the JSP page through the virtual directory apple or cloud. For example, save example1_1.jsp to D:\ Mybook\ zhang or C:\ wang, and enter:
Http://127.0.0.1:8080/apple/example1_1.jsp
Or
Http://127.0.0.1:8080/cloud/example1_1.jsp IV. Set up relative directories
The directory under the Web service directory is called the relative Web service directory under the Web service directory.
For example, we can create a subdirectory image under the Web service directory D:\ Mybook\ zhang and save the example1_1.jsp file to image. You can access example1_1.jsp at the following address in the browser's address bar:
Http://127.0.0.1:8080/apple/image/example1_1.jsp so far, I believe you have a deeper understanding of "how to set up the Web service directory on the Tomcat application server". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.