changing app root for spring mvc app on tomcat

前端 未结 1 356
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 17:46

I am working with a sample RESTEasy 2.0 resource on Spring MVC 3.0 and deplying to Tomcat 6. I can get to my resource through http: //localhost:8080/examples-resteasy-2.1-SN

相关标签:
1条回答
  • 2020-12-30 18:47

    You can set these in your Tomcat server.xml.

    Add a <Context> element within the <Host> like below which sets your examples-resteasy-2.1-SNAPSHOT as the default web app.

    <Context docBase="examples-resteasy-2.1-SNAPSHOT" path="" reloadable="true" />
    

    This should allow you to access it as http: //localhost:8080/contacts

    Set the path to "myservice" like below

    <Context docBase="examples-resteasy-2.1-SNAPSHOT" path="/myservice" reloadable="true" />
    

    should allow you to access it as http: //localhost:8080/myservice/contacts

    0 讨论(0)
提交回复
热议问题