1

When I deploy my app in dev environment it works fine. When I try to deploy it on production environment, Tomcat gives additional path parameter which cause problems in my app.

Example: localhost:port/home.html -> localhost:port/AppName/home.html

Same goes to static resources eg. My Image is located at adress: localhost:port/static/index.jpg and on production env I need to put localhost:port/AppName/static/index.jpg

Is there any Spring configuration that helps to aovid that? Do you know any solutions for this problem?

wacik93
  • 283
  • 1
  • 7
  • 16

2 Answers2

1

Simple solution without changing your server configuration.delete ROOT.war from your server and paste your war here rename it as ROOT.war.

Second solution is find your server.xml. add context here

 <Context path="/" docBase="your application name here" reloadable="true" />

don't forget path="/". And change if existing source has the path "/" to something else so it will not conflict.

Prashant Thorat
  • 1,752
  • 11
  • 33
  • 54
0

It seems other people have already ask themselves the same question. These answers may help you (You just need to name you app as root.war):

Detailed explanation

Short one

Community
  • 1
  • 1
Hellzzar
  • 185
  • 1
  • 9