2

I want to add my own application name as the prefix. Example: http://localhost:8084/MyApp/some-url. But when I click on some link (href) it redirects me to http://localhost:8084/some-url. Also I've added server.servlet.context-path=/MyApp in properties file. Note: I'm using spring boot 2.5.4v and embedded tomcat 9.0.53v

Waseem
  • 103
  • 1
  • 1
  • 8
  • I'm currently testing with the same versions and it works fine with `server.servlet.context-path=/MyApp` attached. See https://stackoverflow.com/questions/20405474/add-context-path-to-spring-boot-application – İsmail Y. Sep 23 '21 at 09:44
  • @İsmailY. Not working in my case. – Waseem Sep 23 '21 at 09:49
  • Share your files (application.properties etc.) in your case with us. – İsmail Y. Sep 23 '21 at 10:01
  • application.properties `server.servlet.context-path=/MyApp` Controller: `@RequestMapping("/some-url") public String somePage(Model model) { model.addAttribute("message", "Hello world!"); return "some-page"; }` – Waseem Sep 23 '21 at 10:06

0 Answers0