Tomcat Domain Name - Project

*, configure the server.xml file of tomcat to access the domain name and directly jump to the specified page

<Host name="域名" debug="0" appBase="webapps"
	unpackWARs="true" autoDeploy="true"
	xmlValidation="false" xmlNamespaceAware="false">
	<Context path="/" docBase="The absolute path of the project or the project name under webapps can be used"></Context>
</Host>

 After this configuration, directly access: (domain name/) to access (domain name/target.jsp)

    Remarks: This solution only provides a way to access the project through the domain name. If you want to truly hide the project name, you need to do some other work.

 

*, the process of domain name access request

 

First visit the index.html/index.jsp/index.htm file in the root directory (if any)
-------The order depends on the welcome-file-list configuration of web.xml in the conf folder under tomcat
-------TIP: files under root can access resources in other projects with the same path
Then look at the context and docbase properties in the host configuration option of server.xml (see if the default project name is specified)
Then you will enter the project, that is, enter the filter of the project
 

 

 

*, jump to another jsp page in the jsp page (below web-inf) - the address bar remains unchanged

<jsp:forward page="/WEB-INF/*.jsp"/>

 

*, jsp page jumps to action

<script>
      window.location.href='*.action';
</script>

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326296398&siteId=291194637