java - Where is Spring MVC context path set? -


i not sure how context path set. when rename .war file in tomcat on autodeploy, web page goes localhost:8080/newdirectory expected, reason wherever there's call pagecontext.request.contextpath in spring based page, still returns old context path.

i tried override context path setting:

<context path="/newdirectory" docbase="appname" override="true"></context> 

in server.xml doesn't work.

my question is, spring read context path from? used maven , did see there's

<appcontext>/${project.artifactid}</appcontext> 

in pom.xml, mean need rename artifactid newdirectory ?

i have tried adding <context path="/newdirectory"...> in /meta-inf/context.xml (which know ignored anyway due server.xml changes).

thanks in advance answer.

every pagerequest current httpservletrequest object , context path of current request , append .jsp (that work if context-path resource accessed @ changes).

eg,

if have war file mycompany.war , having page ${pagecontext.request.contextpath}/myjsppage.jsp.

then context path http://abc/mycompany , works http://abc/mycompany/myjsppage.jsp. 

suppose if change war file ourcompany.war,

then context path changes http://abc/ourcompany , jsp work http://abc/ourcompany/myjsppage.jsp. 

it means context path change automatically name of application(war file name) out changes.

in case,after renaming war file name newdirectory,your webserver deploy newdirectory application still newdirectory application exist in web server.i think should delete old application webapp , check reloading newdirectory application.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -