0

I am trying to change my Spring MVC project's root URL to '/' instead of '/springmvc' by default.

For example, I want the root url (which is mapped to @RequestParam('/')) to be http://localhost:8080/ instead of http://localhost:8080/springmvc

How could I do this? Thank you!

Alex P.
  • 30,437
  • 17
  • 118
  • 169
Kevin
  • 1
  • How and where are you running this application? – Robert Moskal Jul 02 '15 at 23:04
  • If this is a traditional spring application, packaged in a war then it's up the to servlet container to specify the root url for the application. You can always force an application to be served from the root, but it's going to be done differently depending on whether you are using tomcat, jetty, etc. – Robert Moskal Jul 02 '15 at 23:07
  • im running it on Tomcat in Eclipse – Kevin Jul 02 '15 at 23:07
  • possible duplicate of [Tomcat 6: How to change the ROOT application](http://stackoverflow.com/questions/715506/tomcat-6-how-to-change-the-root-application) – Robert Moskal Jul 02 '15 at 23:08
  • i'll look into this.. thanks Rob, I have been searching for 30 mins but couldn't find the correct thread – Kevin Jul 02 '15 at 23:10
  • You can try this approach: https://stackoverflow.com/questions/20405474/add-context-path-to-spring-boot-application – Filipe Luchini Mar 20 '18 at 20:55

0 Answers0