Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 824
user1452140 Avatar asked Jan 15 '23 15:01

user1452140


1 Answers

  • 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
like image 130
Dirk Lachowski Avatar answered May 10 '23 11:05

Dirk Lachowski