gs-rest-service-0.1.0.war复制到tomcat-9.0.0.M17\webapps\
打开server.xml,这Host节点,加入<Context path="/gs" docBase="gs-rest-service-0.1.0.war" debug="0" privileged="true"/>
gs相当于虚拟目录,docBaset填写相对应Host 的 appBase的地址,加后缀war
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="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" />
<!-- Tomcat Manager Context -->
<Context path="/gs" docBase="gs-rest-service-0.1.0.war" debug="0" privileged="true"/>
</Host>
可以用地址访问:
http://localhost:8080/gs/greeting/
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步