我的spring boot application.yml:
server:
port: 9999
servlet:
context-path: /test我把war包放到tomcat war应用程序和我的server.xml中
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/" docBase="test" debug="0" privileged="true" reloadable="true"/>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>当我访问localhost:9999/test/index时,它不工作。正确的配置是什么?
发布于 2019-07-23 18:49:57
据我所知,如果您希望将tomcat作为localhost运行,则必须更改tomcat的端口: 9999 /test/index 9999应该是tomcat的端口,webapp将在该端口上响应
https://stackoverflow.com/questions/57161844
复制相似问题