Is there a way to get the absolute path of the context root in tomcat?

后端 未结 1 1274
南笙
南笙 2021-01-14 01:10

I have a problem that, after a lot of reading and research, seems like tomcat is running another instance of itself and thus serving an old version of my updated app (or som

相关标签:
1条回答
  • 2021-01-14 01:52

    To answer the question in the title, let your code basically do the following:

    System.out.println(getServletContext().getRealPath("/"));
    

    To solve the problem described in the question, shutdown Tomcat and delete everything in its /work directory, delete the expanded WAR in /webapps and remove the /Catalina subdirectory of /conf directory (if any) and then restart.

    0 讨论(0)
提交回复
热议问题