I am not sure how context path is set.
When I rename my .war file
in tomcat on autodeploy
, the web page goes to localhost:8080/newDirectory
as expected, however for some reason wherever there's a call to pageContext.request.contextPath
in a Spring based page, it still returns the old context path.
I tried to override the context path by setting:
<context path="/newDirectory" docBase="appName" override="true"></context>
in server.xml
but it doesn't work.
My question is, where does Spring read its context path from? I used Maven and I did see there's a
<appContext>/${project.artifactId}</appContext>
in the pom.xml
, does this mean I need to rename the artifactId to newDirectory ?
I have also tried adding that <context path="/newDirectory"...> in /META-INF/context.xml
(which now I know will be ignored anyway due to my server.xml
changes).
Thanks in advance for your answer.