Tomcat sets the default startup project
Tomcat sets the default startup project. As the name suggests, you can enter IP: 8080 in the address bar of your browser to access our project. The procedure is as follows:
1. Open the installation root directory of Tomcat and find Tomcat 6.0 \ conf \ Server. XML, open the file, find the
2. Put the webtest project under the Tomcat root directory, and delete or rename the root folder in the webapps folder to another name.
3. start Tomcat and enter IP: 8080 in the browser to access your project.
Note: the value of the docbase attribute in the <context> node is the absolute path pointing to the web project.
WEB Project Settings default start page
The default startup page of Java Web project settings is configured through the Web. xml file. The specific configuration is as follows:
<Servlet>
<Servlet-Name> startservlet </servlet-Name>
<Servlet-class> nvmp. videoserver. Implement. startservlet </servlet-class>
<Load-on-startup> 0 </load-on-startup>
</Servlet>
<Servlet-mapping>
<Servlet-Name> startservlet </servlet-Name>
<URL-pattern>/startservlet </url-pattern>
</Servlet-mapping>
<Welcome-file-List>
<Welcome-File> login. jsp </welcome-File>
</Welcome-file-List>
Find the tomcat installation path and open the server. xml file in the conf Folder: add
The following code is the red part.
<Context Path = "" DEBUG = "0" docbase = "E: \ your oft \ Tomcat 6.0 (Tomcat 7.0) \ webapps \ open your project name by default"/>
The modified server. xml file is shown below. After testing, 6.0 and 7.0 are normal.
<? XML version = '1. 0' encoding = 'utf-8'?> <! -- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. see the notice file distributed with this work for additional information regarding copyright ownership. the ASF licenses this file to you under the Apache license, version 2.0 (the "License"); you may not use this file license t in compliance with the license. you may obtain a copy of the license Http://www.apache.org/licenses/LICENSE-2.0 unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. see the license for the specific language governing permissions and limitations under the license. --> <! -- Note: A "server" is not itself a "container", so you may not define subcomponents such as "valves" at this level. documentation At/docs/config/server.html --> <server port = "8005" shutdown = "shutdown"> <! -- APR library loader. Documentation At/docs/apr.html --> <listener classname = "org. Apache. Catalina. Core. aprlifecyclelistener" sslengine = "on"/> <! -- Initialize Jasper prior to webapps are loaded. Documentation At/docs/jasper-howto.html --> <listener classname = "org. Apache. Catalina. Core. jasperlistener"/> <! -- JMX support for the Tomcat server. documentation At/docs/non-existent.html --> <listener classname = "org. apache. catalina. mbeans. serverlifecyclelistener "/> <listener classname =" org. apache. catalina. mbeans. globalresourceslifecyclelistener "/> <! -- Global JNDI Resources Documentation At/docs/jndi-resources-howto.html --> <globalnamingresources> <! -- Editable user database that can also be used by userdatabaserealm to authenticate users --> <Resource Name = "userdatabase" auth = "Container" type = "org. apache. catalina. userdatabase "Description =" user database that can be updated and saved "factory =" org. apache. catalina. users. memoryuserdatabasefactory "pathname =" CONF/tomcat-users.xml "/> </globalnamingresources> <! -- A "service" is a collection of one or more "connectors" that shares a single "Container" Note: A "service" is not itself a "container ", so you may not define subcomponents such as "valves" at this level. documentation At/docs/config/service.html --> <service name = "Catalina"> <! -- The connectors can use a shared executor, you can define one or more named thread pools --> <! -- <Executor name = "tomcatthreadpool" nameprefix = "Catalina-Exec-" maxthreads = "150" minsparethreads = "4"/> --> <! -- A "connector" represents an endpoint by which requests are already ed and responses are returned. documentation at: Java HTTP connector:/docs/config/http.html (blocking & non-blocking) Java AJP Connector:/docs/config/ajp.html APR (HTTP/AJP) connector: /docs/apr.html define a non-ssl http/1.1 Connector on port 8080 --> <connector Port = "8080" protocol = "HTTP/1.1" connectiontimeout = "20000" Redirect Port = "8443"/> <! -- A "connector" using the shared thread pool --> <! -- <Connector executor = "tomcatthreadpool" Port = "8080" protocol = "HTTP/1.1" connectiontimeout = "20000" redirectport = "8443"/> --> <! -- Define a ssl http/1.1 Connector on port 8443 this connector uses the JSSE configuration, when using Apr, the connector shocould be using the OpenSSL style configuration described in the APR documentation --> <! -- <Connector Port = "8443" protocol = "HTTP/1.1" sslenabled = "true" maxthreads = "150" Scheme = "HTTPS" secure = "true" clientauth = "false" sslprotocol = "TLS"/> --> <! -- Define an AJP 1.3 connector on port 8009 --> <connector Port = "8009" protocol = "AJP/1.3" redirectport = "8443"/> <! -- An engine represents the entry point (within Catalina) that processes every request. the engine implementation for Tomcat stand alone analyzes the HTTP headers encoded with the request, and passes them on to the appropriate host (virtual host ). documentation At/docs/config/engine.html --> <! -- You shoshould set jvmroute to support load-balancing via AJP ie: <engine name = "standalone" defaulthost = "localhost" jvmroute = "jvm1"> --> <engine name = "Catalina" defaulthost = "localhost"> <! -- For clustering, please take a look at documentation at:/docs/cluster-howto.html (simple how to)/docs/config/cluster.html (reference documentation) --> <! -- <Cluster classname = "org. Apache. Catalina. Ha. tcp. simpletcpcluster"/> --> <! -- The request dumper valve dumps useful debugging information about the request and response data stored Ed and sent by Tomcat. Documentation at:/docs/config/valve.html --> <! -- <Valve classname = "org. Apache. Catalina. Valves. requestdumpervalve"/> --> <! -- This realm uses the userdatabase configured in the global JNDI resources under the key "userdatabase ". any edits that are stored med against this userdatabase are immediately available for use by the realm. --> <realm classname = "org. apache. catalina. realm. userdatabaserealm "resourcename =" userdatabase "/> <! -- Define the default virtual host Note: XML Schema validation will not work with xerces 2.2. -->
Tomcat opens project settings by default