Testing New Spring MVC Project in STS - Default Root Context?

蹲街弑〆低调 提交于 2019-12-06 04:20:59

问题


I'm trying to get into the Spring MVC world and I'm starting by using SpringSource Tool Suite. I've created a new Spring MVC project and I understand the basics. The quick question I have is - what's the best way to change the root context of the default vFabric server that comes with STS?

By default it maps my project to /projectname - but when I finally deploy this project I want it to be in the root context /. Is there a way to change this within STS/vFabric so when I "Run On Server" and it starts up the Tomcat instance, the current project will be in the root context and not the default "VMware vFabric tc Server" page? This just makes it difficult to test out the site since I would be linking to "/mylink" (for example) in the HTML but when running in STS it would be /projectname/mylink

Thanks.


回答1:


  • In the "Servers"-View, right click on the vFabric server
  • select "open"
  • In the opening editor, click on "Modules" (at the bottom of the editor window)
  • You will see your deployed apps, click on the one that should be deployed to ROOT
  • click "edit"
  • change the path to "/", leave the docbase as is
  • save and done


来源:https://stackoverflow.com/questions/12305077/testing-new-spring-mvc-project-in-sts-default-root-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!