Java Web basics: Web application configuration

Source: Internet
Author: User

 

Suppose hello. the JSP access path is: http: // 127.0.0.1: 8080/bookstore/hello. JSP, and when we access the Internet, usually only need to write a domain name or IP address can be, such as http://www.google.com, www.google.com is a domain name, need to buy at the domain name management center, then, the domain name and IP address are associated. So the http://www.google.com is equivalent to http: // 127.0.0.1. Next we will introduce how to configure to avoid writing other parts (8080/bookstore/Hello. jsp ). Configure port8080 is the port occupied by the application. If the port is 80, it can be left empty. The port must be configured in server. XML (in the conf folder of the tomcat installation directory. In server. find the following code in XML: <connector Port = "8080" protocol = "HTTP/1.1" maxthreads = "150" connectiontimeout = "20000" redirectport = "8443"/> change 8080 in the code to 80. Note: After modification, You need to restart the server. Configure ApplicationThe configuration application is also carried out in server. xml. In server. find the following code in XML: Configuration welcome FileIf you do not enter a file name when accessing the application, the system accesses the welcome file. the configuration in XML allows you to define multiple welcome files. The system will search for the welcome files in order, and the system will display the files if they exist. Add the following code before </Web-app>. <Welcome-file-List> <welcome-File> index.html </welcome-File> <welcome-File> index.htm </welcome-File> <welcome-File> index. in the JSP </welcome-File> </welcome-file-List> example, 3 Welcome files index.html?index.htm and index are set. JSP to display the file that exists when accessing the application. Last Lecture: Lecture 8: Java Web Development HistoryNext Lecture: Java Web basics: Overview of Web application InputLi xucheng csdn blog: Why? U= 124362 & C = 7be8ba2b6f3b6cc5

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.